summary refs log tree commit diff stats
path: root/tests/stdlib/tstrutil.nim
Commit message (Collapse)AuthorAgeFilesLines
* 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