summary refs log tree commit diff stats
path: root/tests/stdlib/tstrformat.nim
Commit message (Collapse)AuthorAgeFilesLines
* test removing dollar for objects out of system (#20242)metagn2022-08-241-0/+3
| | | | | | | | | | | * test removing dollar for objects out of system * test & fixes * fix bootstrap * use nimPreviewSlimSystem, test stdlib category * fix test
* followup strformat PR. backslash escapes, tests, docs (#17700)shirleyquirk2021-04-121-2/+60
| | | | | | | | | | | | | | | | | | | | | | * Allow use of colons inside fmt allowing colons inside fmt by replacing the format specifier delimiter lets arbitrary nim code be run within fmt expressions. Co-authored-by: flywind <xzsflywind@gmail.com> * formatting,documentation,backslash escapes Adding support for evaluating expressions by special-casing parentheses causes this regression: `&"""{ "(hello)" }"""` no longer parses. In addition, code such as &"""{(if open: '(' else: ')')}""" wouldn't work. To enable that, as well as the use of, e.g. Table constructors inside curlies, I've added backslash escapes. This also means that if/for/etc statements, unparenthesized, will work, if the colons are escaped, but i've left that under-documented. It's not exactly elegant having two types of escape, but I believe it's the least bad option. * changelog * added json strformat test * pulled my thumb out and wrote a parser Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: flywind <xzsflywind@gmail.com>
* Improve the strformat module (#17106)konsumlamm2021-02-201-512/+498
| | | | | | | | | | | | | | | | | | | | | | * Improve the strformat module Improve documentation Use runnableExamples * Fix overflow error for low(int64) Add test * Use assert in runnableExamples * Improve tstrformat Put tests in proc & test VM Put tests in blocks Add c, js targets * Use doAssert in tests * Disable JS & VM tests
* use doAssert in tests (#16486)flywind2020-12-281-2/+2
|
* move tests to testament (#16101)flywind2020-11-241-1/+138
| | | | | | | | | * move tests to testament * minor * fix random * disable test random
* add docs and more tests for debug format strings (#14861)flywind2020-07-081-3/+70
| | | | | | | | | | | | | | | | | * add debug format string * remove try except * add changelog * add docs and more tests * Update lib/pure/strformat.nim Co-authored-by: Juan Carlos <juancarlospaco@gmail.com> * minor Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
* add debug fmt string like python's (#14808)flywind2020-06-301-0/+105
| | | | | | | * add debug format string * remove try except * add changelog
* [cleanups] doassert => doAssert; mark deadcode (#14711)Timothee Cour2020-06-171-2/+2
|
* fixes #14054 [backport:1.2] (#14061)Andreas Rumpf2020-04-301-0/+31
| | | | | | | | | * fixes #14054 * make tests green again * more tests are green * maybe now
* fixes #12612 [backport] (#12681)Andreas Rumpf2019-11-191-0/+8
|
* [feature]strformat: add 2 'fmt' macros that use specified characters instead ↵Tomohiro2019-10-281-0/+32
| | | | | | | | | | of '{}' (#11748) * [feature]strformat: add 2 'fmt' macros that use specified chars instead of '{}' * strformat: revert documentation comments of `&` and 'fmt' * strformat: removed single open/close char variant of fmt
* fixes #11723Araq2019-07-151-0/+18
|
* move test for #7632 above `import strformat` (#11270)jcosborn2019-05-201-10/+11
|
* fixes another regression; the behaviour of 'array' formatting was changedAraq2019-04-151-0/+8
|
* fixes #11012Araq2019-04-151-6/+18
|
* Strformat symbol binding (#10927)Arne Döring2019-04-051-2/+42
|
* Fix strformat neg zero (#7954)skilchen2018-06-051-0/+8
| | | | | | | | * fix strformat handling of neg zero with sign * better tests for neg zero with sign * use inplace insertion of the sign as suggested by Varriount
* Fix strformat precision handling for strings (#7941)skilchen2018-06-041-0/+26
| | | | | | | | * fix strformat precision handling for strings * add some limited unicode awareness to the precision handling for strings * improvement suggested by Varriount: use setLen and runeOffset instead of runeSubstr
* fix strformat zeropadding for floats (#7934)skilchen2018-06-011-1/+10
|
* fixes #7078Araq2018-01-141-2/+2
|
* rename strformat.fmt to `%` as it works better with backslash escape ↵Araq2018-01-111-2/+2
| | | | sequences; refs #6958
* Add test caseOscar Nihlgård2018-01-091-0/+13