summary refs log tree commit diff stats
path: root/tests/stdlib/tstrutil.nim
Commit message (Collapse)AuthorAgeFilesLines
* Add strutils.indentation and make unindent use it (#15264)Clyybber2020-09-221-0/+22
| | | | | | | | | | | | | | | | | | | | | | | * Add strutils.indentation and make unindent use it * Code style * Fix bootstrapping * Improve wording * Fix test * Introduce without breaking change * Fix * Reduce diff * Fix docs link * Add since annotation * Update changelog
* fix #15257, `toHex` couldn't handle large uint64 (#15261) [backport:1.2]Miran2020-09-041-2/+4
|
* make tests/stdlib tests joinable (#14626)Timothee Cour2020-06-151-6/+4
| | | | | * make tests/stdlib tests joinable * fixup
* parseEnum_regression (#14150)cooldome2020-04-281-2/+2
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-1/+1
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* base `parseEnum` on a case statement, fixes #14030 (#14046)Vindaar2020-04-221-0/+87
| | | | | | | | | | | | | | | | | | | | * base `parseEnum` on a case statement, fixes #14030 * apply simplifactions / clean up, remove `norm` node, use strVal * export `normalize` in json.nim * cmp using nimIdentNormalize, error at CT if ambiguous enum found `nimIdentNormalize` provided by @cooldome. We track all names of the branches we have created so far and error if a duplicate is found. Dummy change to make github react... * fix docstring of `nimIdentNormalize` * make `typ` arg `typedesc`, add lineinfo, call norm. only once
* Version of trimZeros without temp strings (#12633)b3liever2019-11-111-0/+36
|
* remove deprecated procs (#12535)Andreas Rumpf2019-11-051-28/+1
|
* Attempt to close https://github.com/nim-lang/Nim/issues/11430Charles Blake2019-06-121-7/+14
|
* fixes #11369 (#11381)Andreas Rumpf2019-06-021-0/+7
|
* require errormsg to be specified before file.Arne Döring2018-12-111-1/+0
|
* fixes #8911Andreas Rumpf2018-09-161-0/+15
|
* Fixed 7478: splitLines keepEol option (#8621)Iván Montes2018-08-131-1/+8
|
* Add parse bin int, fixes #8018 (#8020)Vindaar2018-06-131-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * clarify `parseHexInt`, `parseOctInt` docstring and exception msgs * add `parseBinInt` based on `parseutil.parseBin` implementation Adds a `parseBinInt`, which parses a binary integer string and returns it as an integer. This is based on the implementation of `parseutil.parseBin`, removing the unnecessary parts. * add tests for all `parse(Hex|Oct|Bin)Int` procs * replace `parse*Int` proc impls by call to parseutil procs Replaces the `parse(Hex|Oct|Bin)Int` procedure implementation by calls to the `parseutil` procs, which receive a mutable argument. Has the main advantage that the empty string as well as a "prefix only" string, e.g. "0x" counts as an invalid integer. Also moves the `parseOctInt` proc further up in the file so that all `parse` procs are below one another. * replace `var L` by `let L` in `parse` procs There's no reason for the usage of `var` here. * add `maxLen` optional arg for `parseutil.parse(Oct|Bin)` Plus small change to test cases. * update changelog about `parse*Int` procs * fix `rejectParse` template in `tstrutils` * make sure only `s.len` chars are parsed, if `maxLen+start` > s.len Fixes a previous bug in `parseHex` (and now affected `parseOct` and `parseBin`), which allowed to set `start + maxLen` to be larger than the strings length. This resulted in an out of bounds access. * move `parse*Int` proc change to breaking changes, add double `
* Add string-to-hex and back conversionsFederico Ceratto2017-11-271-0/+18
| | | | Add parseHexStr and toHex and tests.
* Update `removeSuffix` implementations to match `removePrefix` (#6636)Bo Lingen2017-10-301-4/+26
|
* add `strutils.removePrefix` proc (#6473)Bo Lingen2017-10-281-0/+62
|
* isAlphaNumberic and isDigit improvement + tests (#6579)Viktor Marosvary2017-10-241-0/+19
| | | if we encounter a character that does not satisfy the proc, we return immediately, without continuing to loop over the rest of the chars in the string.
* Fix wrong result of countLines() (#6371)Simon Krauter2017-09-151-0/+12
|
* Improve & optimize strutils 'find' procs (#5196)Parashurama2017-01-111-0/+27
| | | | | * add 'last' argument to 'find' procs in strutils * add 'rfind' proc for looking up set[char] in strutils * use optimised C function 'memchr' when available
* Add a unit test that covers issue 3477Charles Blake2015-11-191-0/+1
| | | | https://github.com/nim-lang/Nim/issues/3477
* Update tests to proposed changesZach Aysan2015-07-211-16/+39
|
* Add tests for chompZach Aysan2015-07-171-4/+21
|
* Replaced repeatStr() and repeatChar() with more natural versions.Hans Raaf2015-03-031-2/+8
|
* Added test for toHex().Hans Raaf2015-02-181-24/+27
|
* strutils.rfind via chardyu2014-12-191-0/+4
|
* new tester; all tests categorizedAraq2014-01-131-0/+45