Commit Graph

674 Commits

Author SHA1 Message Date
Miran
e922d73dd6 refs #4347, add ZZZ and ZZZZ patterns for timezone offsets without colons (#17318) 2021-03-11 16:32:50 +01:00
Timothee Cour
eb07a5a75b add typetraits.OrdinalEnum, enumutils.symbolName (#17281) 2021-03-10 08:08:24 -08:00
flywind
cc37fee0ab fix #17275 (#17276) 2021-03-09 12:22:26 +01:00
flywind
761ec2ccc8 improve test coverage for isolation (#17297)
* improve test coverage for isolation

* a bit better
2021-03-08 22:21:57 +08:00
flywind
dd8383b10a add testcase for #12005 (#17278)
* remove unnecessary when statement

* remove outdated codes

* reuse jsffi

* move js json coverage

* close #12005 add testcase

* Update tests/stdlib/tthreadpool.nim

* Update tests/stdlib/tthreadpool.nim

* Update tests/stdlib/tthreadpool.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-03-08 14:37:52 +01:00
Timothee Cour
93cb5d6896 add setutils.[]= (#17272)
* add setutils.[]=
* address comments
* proc => func (for other symbols too)
2021-03-08 10:39:39 +01:00
Roman Inflianskas
31424b3808 stdlib/os: add isAdmin (#17012)
* stdlib/os: add isAdmin

* uint8 -> cuchar, assert isAdmin on Azure

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Update lib/pure/os.nim docs

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Address comments on #17012

* Raise on errors in #17012

* Check the result of FreeSid in #17012

* Change case in #17012

* Fix memory leak in #17012

* Address comments in #17012

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-03-07 22:40:16 +01:00
flywind
0e3ea16554 use lowercase --define switches (#17283) 2021-03-07 12:08:41 +01:00
flywind
171b03c386 fix #17264 [backport:1.4] (#17266)
* fix #17264
* fix vm
* fix js and add tests
2021-03-05 14:39:46 +01:00
flywind
cda443ee68 follow up #17165 (#17262) 2021-03-04 22:41:20 -08:00
flywind
81889fb84c reuse jsffi in json module (#17165)
* remove unnecessary when statement

* remove outdated codes

* reuse jsffi

* move js json coverage
2021-03-04 19:37:12 +01:00
Jason Beetham
c180de60a8 Added math.clamp for slice clamping (#17246)
* Added math.clamp for slice clamping

* Added inline to math.clamp

* Cleaned up math.clamp + test
2021-03-03 23:54:23 +00:00
flywind
6391f6e861 fix #16384 and #17144 (#17126) [backport] 2021-03-03 11:58:50 +01:00
Juan Carlos
4982d1c662 https://github.com/nim-lang/Nim/pull/15826/files#r585368355 (#17233) 2021-03-03 11:58:05 +01:00
Andrey Makarov
02f4464058 RST heading improvements (fix #17091) (#17195) 2021-03-02 16:41:10 +01:00
Timothee Cour
f1bf672ffc re-enable disabled tests after #17173 (#17228) 2021-03-02 12:53:05 +01:00
Timothee Cour
0cb02fbbee add overload add(a: var string, b: openArray[char]) (#15951)
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-03-01 07:51:12 -08:00
Timothee Cour
63f1c38f4e hashes: support object default hash (#17175) 2021-02-26 08:45:37 +01:00
Timothee Cour
578d1ee751 std/options: $some(3) is now "some(3)", etc. (#17147)
* std/options: $some(3) is now "some(3)", not "Some(3)", `$none(int)` is now `"none(int)"` instead of `"None[int]"`

* fix tests

* disable optionsutils
2021-02-24 22:17:16 +00:00
flywind
99633d7682 remove deprecated stuff in unittest module (#17156)
* remove unnecessary when statement

* remove outdated codes

* remove deprecated stuff in testament

* fix
2021-02-24 21:02:33 +01:00
Timothee Cour
8942586fa6 wrapnils: add ??. which returns an Option (#16931)
* wrapnils: add option-like API with ??., isSome, get
* fix test after rebase
* cleanups
* fix changelog
* address comments regarding get vs unsafeGet
2021-02-24 14:02:32 +01:00
Timothee Cour
11a7fa68f6 fix #17159 items(cstring) works in VM (#17160)
* fix #17159 items(cstring) works in VM

* improve test coverage tests/stdlib/tcstring.nim; add helpers: whenRuntimeJs, whenVMorJs

* document items(cstring)

* address comments
2021-02-24 14:01:06 +01:00
Timothee Cour
0bb7e8dcb4 cleanup tests/stdlib/tstring.nim (#17158)
* cleanup tests/stdlib/tstring.nim

* cleanup tests/stdlib/tstring.nim

* cleanup rest of test
2021-02-24 13:47:36 +01:00
flywind
cbe3c993b6 close #15563 add testcase (#17168)
* remove unnecessary when statement

* remove outdated codes

* close #15563

* Update tests/typerel/t15563.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* address comments

* tiny

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-02-24 13:44:10 +01:00
flywind
3f38f8fbb7 add strbasics.strip (#16280) 2021-02-24 10:22:47 +01:00
flywind
46bd222c89 [stdlib] make cookies module modern (#17116)
* update cookies module
* introduce sameSite.Default

Co-authored-by: hlaaftana <10591326+hlaaftana@users.noreply.github.com>
2021-02-24 10:14:19 +01:00
Timothee Cour
c274e67198 add enumutils.items for sparse enums, typetraits.SomeSparseEnum (#17080)
* add enumutils.items for enum with holes
* changelog
* ref in lib.rst
* use `type SomeSparseEnum* = (not Ordinal) and enum` instead of concept
* address comment: rename back to enum with holes
2021-02-23 20:25:35 +01:00
Timothee Cour
ce7caec4b3 add io.readChars overload (simpler, less error prone) (#16044)
* add simpler to use readChars overload

* use new readChars overload

* Update lib/wrappers/openssl.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: flywind <xzsflywind@gmail.com>
2021-02-22 20:13:08 +01:00
konsumlamm
a1f4113705 Improve the ropes module (#17145)
* Improve ropes module

Improve wording
Update runnableExamples
Add index bound check for `[]`
Minor format changes

* Update tests/stdlib/tropes.nim

Run on C & JS target
Test in VM
Add tests for `[]`
2021-02-22 19:58:37 +01:00
rockcavera
d76d79336f fix #15215 (#17142)
* fix 15215

* fix test

* end line

* Update tests/stdlib/tnetconnect.nim

Co-authored-by: flywind <xzsflywind@gmail.com>

* Update lib/pure/net.nim

Co-authored-by: flywind <xzsflywind@gmail.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-02-22 17:40:57 +01:00
flywind
f07a072691 [JS + docs] improve std/monotimes module (#17103) 2021-02-22 11:09:25 +01:00
Andrey Makarov
fab1618eb4 make rst.nim use object variant (#17138)
* make rst.nim use object variant

* add workaround

* fix mistake
2021-02-22 11:00:31 +01:00
flywind
32bf10126c fix #17118 (#17119) [backport:1.2]
* fix js unsigned integer
* Use `std` prefix for standard library modules
* fix #17118
2021-02-22 09:14:18 +01:00
Timothee Cour
cde950e1bc make copySign for js consistent with other backends (#16609)
* make copySign work more robustly in js
* improve tests
* improve tests/vm/tcastint.nim
2021-02-22 08:47:00 +01:00
flywind
146beb2797 remove unnecessary when statement (#17135) 2021-02-21 11:17:25 +01:00
Timothee Cour
e94a3e5fcd move prelude so that include std/prelude also works (#17110)
* move prelude so that `include std/prelude` also works

* add test
2021-02-20 18:08:13 +01:00
konsumlamm
bd199a8d31 Improve the strformat module (#17106)
* 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
2021-02-20 18:06:29 +01:00
Timothee Cour
6b3bdd798d enable bsd for tsetutils; improve setutils API (#17098) 2021-02-20 18:02:57 +01:00
Andrey Makarov
d1fec552d0 stricter checks for RST headlines (#17089) 2021-02-20 18:01:45 +01:00
Timothee Cour
0fcf1af765 uri: document removeDotSegments, add tests, show failure modes (#17064)
* uri: document removeDotSegments, add tests, show failure modes
* address comments
2021-02-20 17:58:54 +01:00
flywind
c1a06bd56e close #13859; add testcase (#17099)
* fix js unsigned integer

* better

* close #13859; add testcase
2021-02-19 11:36:35 +01:00
Jason Beetham
35ded02074 Add setutils.complement, setutils.fullSet (#17066) 2021-02-18 17:33:28 -08:00
flywind
301d784256 [nodejs backend] paramStr, paramCount (#17082) 2021-02-18 08:26:50 +01:00
flywind
35e14998ec fix math.frexp function signature (#16725) 2021-02-17 19:27:48 +01:00
flywind
4f118721be make system random work in VM (#17059)
* make system random work in VM
2021-02-17 11:52:46 +01:00
Benoit Favre
81703d4ad4 Fix bug in removeDotSegments: added test (#17050)
* Fix bug in removeDotSegments when path ends with dot

* Add test for trailing period bug in uri
2021-02-16 20:20:37 +01:00
konsumlamm
0a9a90d991 Improve documentation for bitops (#16961)
* Improve documentation for bitops

Use func
Use let in runnableExamples

* Remove unnecessary tests

Fix #7587
2021-02-15 21:17:45 +01:00
Andrey Makarov
35bd39a9d0 RST: implement footnotes and citations (#16960)
* RST: implement footnotes and citations
* manual fixup of nimdoc.out.css
* remove unused code
* shorter printing code
* Update lib/packages/docutils/rst.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2021-02-15 14:12:40 +01:00
konsumlamm
56f5010fa4 Improve the heapqueue module (#17034)
Improve documentation
Optimize toHeapQueue
Rename siftup and siftdown
Add tests for the heap property
2021-02-15 13:57:15 +01:00
konsumlamm
afa87f223c Improve math module (#17019)
* Improve documentation for math

Support empty input for cumsummed
Use runnableExamples
Move some examples to tests
Add more tests

* Update tests/stdlib/tmath.nim

Move some tests to trandom.nim
Move tests into main template where possible
Add test for #17017

* Add more tests for gamma & lgamma

Remove gamma(-1.0) example
Small fixes/changes

* Move more tests into template main()

* Fix typos

* Add edge case examples for copySign
2021-02-12 17:13:39 +01:00