Commit Graph

295 Commits

Author SHA1 Message Date
narimiran
f1a78b8b4c tbitops: remove unavailable tests 2019-02-07 09:35:06 +01:00
Arne Döring
c9441c6f79 Vm bitops fixes (#10520) 2019-02-05 15:51:08 +01:00
alaviss
1134f85faa os.walkDir: correctly evaluate paths when relative = true [0.19] (#10173) 2019-01-03 16:35:14 +01:00
narimiran
7beea1642d Revert "os.walkDir: correctly evaluate paths when relative = true"
This reverts commit 123c568236.
2018-12-31 11:20:10 +01:00
alaviss
123c568236 os.walkDir: correctly evaluate paths when relative = true 2018-12-29 10:51:43 +01:00
xzfc
c8786ad197 Fix strscans.scanp (#9518)
* strscans: fix typo

* strscans: fix #9240

* strscans: add tests

(cherry picked from commit 95a60dc780)
2018-11-01 18:02:33 +01:00
Vindaar
5e48d4050e add test case
(cherry picked from commit 557fa85e02)
2018-11-01 17:55:12 +01:00
Miran
38b391ff62 merge stdlib tests (#9439)
(cherry picked from commit 9fb212cfdf)
2018-11-01 17:52:04 +01:00
Vindaar
58726f9b81 fix #9394 by replacing fmt with strutils.% (#9417)
* fix #9394 by replacing `fmt` with normal string append

Until issue #7632 is fixed, use string append.

* use `strutils.%` instead of normal string add

(cherry picked from commit 82a1576263)
2018-11-01 17:50:38 +01:00
Jacek Sieka
7cf3944c38 Testament pre parallel (#9137)
* testament: move to root dir (it's not a test)

* osproc: fix process index passed to afterRunEvent for parallel runs

it was passing the index of the process, not index of all commands

* testament: complete file move

(cherry picked from commit 97738a4f28)
2018-11-01 17:35:08 +01:00
xzfc
73a7d1456c Fix tests on NixOS (#9209) (#9285)
* Replace `/bin/sleep` with just `sleep`, i.e. use environment variable
  `$PATH` to locate binary.
* Replace `/usr/share/zoneinfo` with `$TZDIR` when it is defined,
  fallback to hardcoded path otherwise. This is the same behavior that
  Glibc2 normally have, see man 3 tzset.

(cherry picked from commit 8ed3dac1dc)
2018-11-01 17:31:25 +01:00
Yasuhiro Horimoto
aa8249d177 Fix #9126: use splitPath instead of substr 2018-09-30 23:20:14 +09:00
LemonBoy
a27429304e Convert *_family fields to cushort
Fixes #9008
2018-09-19 12:33:11 +02:00
Vindaar
72a65c43a7 add test case 2018-09-17 19:56:42 +02:00
Andreas Rumpf
0330fb2e13 fixes #8911 2018-09-16 12:28:43 +02:00
Araq
4ab9953787 fixes #8961 2018-09-14 11:40:43 +02:00
Araq
7cea0c1765 closes #5252 2018-09-03 10:16:11 +02:00
gemath
f26ed1d540 Add interpreting event parser proc to pegs module. (#8075)
* Added simple interpreting event parser to pegs module.
* Has side-effects problem.
* Macro solution works.
* First flat callback test works.
* Fixed namespace pollution.
* Added handler for pkChar.
* Replaced event parser test.
* Started extensive docs.
* 'callback' to 'handler' renaming part 1.
* Renaming 'callback' to 'handler' part2, completed comments.
* Fixed exported API pollution.
* Added more event handler hooks, fixed comments.
* Changed event parser addition entry.
* Fixed variable names and comments.
* Enhanced comment.
* Leave handlers are not called for an unsuccessful match.
* The three varieties of back-reference matches are processed in separate
of-clauses now.
* Improved hygiene and (almost) eliminated exports.
* Trying to fix CI test breakage by eliminating export.
* Trying to fix CI test breakage by eliminating exports.
* Re-activated leave handler code execution for unsuccessful matches.
* Eliminated the last export statement (with a funny smelling hack).
* Make sure leave handler code is executed for all unsuccessful matcher
cases.
* Replaced local unicode.`==` with export.
2018-08-24 20:13:37 +02:00
Oscar Nihlgård
1d93991929 Cleanup ttimes (#8714)
* Refactor fromWinTime

* Cleanup ttimes
2018-08-22 17:20:41 +02:00
Dmitry Atamanov
b75808c7d9 Fixes ropes regressions due to the not-nil strings (#8687) 2018-08-20 16:55:22 +02:00
Oscar Nihlgård
33ed8f7e73 times.Timezone changes (#8527)
* Use floorDiv in times.nim

* New implementation of times.Timezone

* Tweak doc comments

* Fix typo
2018-08-17 11:12:58 +02:00
Andreas Rumpf
0da91aa744 changes how the now illegal 'string == nil' comparison is detected 2018-08-15 16:31:56 +02:00
Araq
a0cde8cee6 Merge branch 'devel' into araq-misc 2018-08-13 20:16:18 +02:00
Andreas Rumpf
7f49364fd0 make more tests green 2018-08-13 12:29:03 +02:00
Iván Montes
ee29370f60 Fixed 7478: splitLines keepEol option (#8621) 2018-08-13 11:42:50 +02:00
Timothee Cour
43f634db8d fixes #8519; implements T.distinctBase to reverse T = distinct A (#8531) 2018-08-10 09:20:14 +02:00
Timothee Cour
674bd7bfad fix wrong arch defined(osx) (#8492) 2018-08-02 01:19:29 +02:00
andri lim
2e6d073be1 fixes #8468, stdlib.encodings.convert not crash anymore on windows (#8470) 2018-07-30 12:04:49 +02:00
andri lim
f92d61b1f4 fixes #8037, json.to support object with distinct types (#8086)
* add distinct types to json 'to' macro

* fix json 'to' macro and add more test
2018-07-19 16:38:40 +01:00
Oscar Nihlgård
3b310e91cd New implementations of times.parse & times.format (#8094) 2018-07-09 20:04:25 +02:00
Federico Ceratto
d65429d857 Add normalizePath and tests 2018-07-06 20:21:39 +01:00
Andreas Rumpf
963f431443 Merge branch 'araq-devel' of github.com:nim-lang/Nim into araq-devel 2018-07-06 17:27:02 +02:00
Andreas Rumpf
32230ffe31 make tests green again 2018-07-06 17:26:45 +02:00
Araq
8bcaee1fdf make tmemfile2 work again 2018-07-06 15:53:32 +02:00
Andreas Rumpf
20950ee073 make test green for OSX 2018-07-06 11:26:36 +02:00
Andreas Rumpf
86a7054c88 Merge branch 'devel' into araq-devel 2018-07-04 19:25:53 +02:00
Tomohiro
c79f488027 Fix os.unixToNativePath proc returns wrong result(#8179) (#8181)
* Fix os.unixToNativePath proc returns wrong result(#8179)

* Add tests for unixToNativePath
2018-07-02 17:14:26 +02:00
Andreas Rumpf
c7298561c1 system.nim: remove deprecated symbols 2018-06-28 07:42:46 +02:00
gemath
db68bbe4f7 Pegs AST read access (#8050)
* Make PEG AST nodes readable from outside the module.

* Added a test module for the pegs stdlib module.

* Edited changelog.

* Renamed ``sons`` iterator to ``items``, added ``pairs``, inlined both.

* Updated entry and moved it to the right category.
2018-06-19 18:13:33 +01:00
Dmitry Atamanov
bf5d619a52 Add MemMapFileStream. Fixes in memFiles. (#7944)
* Add MemMapFileStream

* Added tests

* Fixed bug in memfiles (zero index for string)

* Added flush to changelog

* Attempt to fix Win's nuances

* Fix attempt to fix

* Continue...

* And again...

* Reworked tests (all for win on Win)

* Fixes in flush (Win)

* Replace fn vars to consts

* Added the attempts parameter to the flush

* Replace while to for

* Move to memfiles

* Use Natural instead of uint

* Better error messages for append mode. Handle specific cases.
2018-06-14 17:34:26 +01:00
Vindaar
e80be6173d Add parse bin int, fixes #8018 (#8020)
* 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 `
2018-06-13 13:32:12 -04:00
Yuriy Glukhov
b2323de914 Fixed compilation error when Sockaddr_in4 or Sockaddr_in6 passed to fromSockAddr 2018-06-07 21:10:00 +03:00
skilchen
230692a22f Fix strformat neg zero (#7954)
* 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
2018-06-05 00:09:07 -04:00
skilchen
fd102f39bb Fix strformat precision handling for strings (#7941)
* 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
2018-06-04 18:26:16 -04:00
Oscar Nihlgård
05b447374b Use higher time resolution when available in os.nim (#7709) 2018-06-04 14:56:56 +02:00
skilchen
07ff9940f4 fix strformat zeropadding for floats (#7934) 2018-06-01 22:23:50 -04:00
七秒不觉梦
b6b6382e0b Added: type name output when exception raised from unittest (#7869) 2018-05-28 05:24:04 +03:00
Dominik Picheta
f7f69b1abb Merge pull request #7624 from skilchen/fix-issue7620
there is no hour 0 in am/pm time (see #7620)
2018-05-03 16:07:27 +01:00
Araq
ed79201d0b make more tests green 2018-04-30 11:16:56 +02:00
Andreas Rumpf
5237ef4f52 update the documentation about the new strings/seqs behaviours 2018-04-29 08:14:00 +02:00