Commit Graph

566 Commits

Author SHA1 Message Date
flywind
515cd45420 Add math.copySign (#16406)
* add math.copySign
* fix + tests
2020-12-30 15:09:30 +01:00
Antonis Geralis
d5a3c2c2da Added cmpMem export (#16484)
* added cmpMem export

* updates

* fix test

* Tiny changelog change

* Add a dot.

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-29 13:27:08 +01:00
Timothee Cour
fc1a4faf56 improve turi.nim tests: js, vm; merge tdecodequery.nim (#16500)
* improve turi tests: js, vm; merge tdecodequery.nim

* improve test

* add test in js, improve test

* remove   matrix: "--styleCheck:hint --panics:on"

* fixup
2020-12-29 13:26:10 +01:00
Andrey Makarov
e70ac0f34c RST: fix directive with fields (#16490) (#16493)
* RST: fix directive with fields (#16490)

* Update tests/stdlib/trstgen.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-29 03:32:11 +01:00
flywind
6d442a40a6 use doAssert in tests (#16486) 2020-12-28 14:13:21 +01:00
flywind
e718a4a058 follow #15860 clean cgi module (#16487)
* follow #15860  clean cgi module

* follow #15860  clean cgi module
2020-12-27 19:46:21 +01:00
flywind
271f68259b remove some noises in tests (#16448) 2020-12-27 14:45:57 +01:00
flywind
689504081f follow #15357 and move decodeQuery (#15860)
* follow #15357 and move decodeQuery
* solve problem one
* minor
* deprecate decodeData
* add changelog and since
* add testcase for decodeQuery
2020-12-27 11:59:32 +01:00
Andrey Makarov
2bdc479622 RST: implement admonitions (#16438) 2020-12-27 11:16:12 +01:00
flywind
3f9a2ebea5 fix nim js cmp fails at CT (#16473) 2020-12-27 10:13:57 +01:00
flywind
1d615dfda7 fix #16474 unittest.check type1 is type2 gives CT error (#16476)
* fix #16474
* more tests
2020-12-27 09:16:53 +01:00
flywind
b1c3dab208 add euclDiv and euclMod to math (#16414)
* add `euclDiv` and `euclMod` to `math`
* use abs
* Update lib/pure/math.nim

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-23 12:04:38 +01:00
flywind
417c2509c4 strip minor improvement (#16444)
* strip minor improvement
* add more tests
* Update tests/stdlib/tstrutils.nim

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2020-12-23 11:57:48 +01:00
Peter Salvi
051477b314 O(1) concatenation of singly- and doubly linked lists. (#16362)
* O(1) concatenation of singly- and doubly linked lists.

There is also new `toSinglyLinkedList` and `toDoublyLinkedList`
functions for conversion from `openArray`s, similarly
to `toHashSet` or `toTable`.

* Add `sequtils` import to runnable examples with `toSeq`.

* Added missing call to runnable examples.

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* Improved tests for lists.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* More compact tests for lists with templates.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Added extended example to `lists.copy`.

* Corrected .since annotations to 1.6

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Since declarations changed to (1,5,1).

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Changelog update.

* Fix rebasing errors.

* Self-adding with `lists.addMove` results in a cycle now.
Added some extra tests.
2020-12-20 13:09:35 +01:00
Andrey Makarov
9674eb3ca6 RST enumlist followup (#16382)
* fix matching of enumerator #)

* RST: markdown list with auto-enumerator `1`
2020-12-19 10:33:10 +01:00
flywind
0b7847ba3c active windows tests and use doAssert (#16395) 2020-12-18 16:45:51 +01:00
flywind
78acf1becb fix cmpIgnoreStyle bug (#16392) 2020-12-18 16:29:36 +01:00
flywind
e1e069dd6c use hexchar in stdlib (#16290) 2020-12-17 13:41:05 +01:00
Timothee Cour
9ede956662 improve tstrutils: test c, cpp, js, vm; cleanups (#16357)
* renamed:    tests/stdlib/tstrutil.nim -> tests/stdlib/tstrutils.nim

* improve test

* enable tstrutils for js, vm
2020-12-15 14:55:41 +01:00
Jason Beetham
1082d62b08 Adds toSet to create sets from iterables (#16276) 2020-12-14 15:20:21 -08:00
Andrey Makarov
e843492b13 doc/rst2html: some few fixes for enumerated and bullet lists (#16295)
* fix bullet/enumarated lists with many blank lines
* fix enumerated list parsing
* fix parse failure when next line after list empty
* implement arbitrary start of enumerator
* check that enumerators are in order
* remove redundant start=x if x=1 or a
* add some doc on implemented features
* update start in rst_examples.rst
* allow upper-case letters + more docs
2020-12-14 18:10:39 +01:00
Timothee Cour
7e1ae35195 testament: error instead of silently ignore invalid targets; remove pointless alias target vs targets; document matrix; DRY (#16343)
* testament: error instead of silently ignore invalid targets
* s/target/targets/
* fix test; refs #16344
* address comments
* Update testament/specs.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-12-14 10:58:29 +01:00
Bung
5514b299eb add testcase for #15937 (#15933)
* test for issue #15624 and PR #15915 for patch #13823

* Update thashes.nim

no need mention PR #15915, fixed in https://github.com/nim-lang/Nim/pull/15937

* rebase to devel(issue maybe fixed), ignore ouputs

* Apply suggestions from code review

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2020-12-13 11:52:38 +08:00
Jason Beetham
5a58440ebe Added strscans.scanTuple (#16300)
* Added since and changelog
2020-12-12 23:29:20 +01:00
Timothee Cour
b1c232aca1 improve tests for collections (#16328)
* improve tests for collections

* remove remaining code blocks in deques.nim

* improve runnableExamples
2020-12-12 09:33:29 +01:00
Timothee Cour
0b73106ccf add math.isNaN (#16179)
* add math.isNaN
* isNaN now works with --passc:-ffast-math; tests
* Update lib/pure/math.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-12-11 11:01:43 +01:00
flywind
73299b048f enable tests for random (#16297) 2020-12-10 07:58:42 +01:00
Timothee Cour
82bb4db4b7 unittest: use defines instead of env vars (#16165)
* unittest: use defines instead of env vars

* use defines in testament

* fixup

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-12-10 00:57:52 +01:00
Xabier Bello
4c533b2d92 Added Python to highlite module. (#16286)
* Added Python to highlite module.
* Added the keywords for Python

* Refactored the 'pythonLikeNextToken' into 'nimNextToken':

- `lang` property added to GeneralTokenizer object, is set in `getNextToken`.
- `nimNextToken` accepts `keywords` parameter, used for languages different
  from Nim.
- Multiline comment available only for `langNim`.
2020-12-08 10:44:07 +01:00
flywind
48d7c40553 fix #16206 (#16207)
* better docs and tests
* a bit better only clean trailing whitespace
2020-12-06 09:50:46 +01:00
Andrey Makarov
6877e0c8a3 RST tables: fix latex col number; allow less than three of = (#16040) 2020-12-04 08:50:17 +01:00
Antonis Geralis
808ab7eae2 add collect with infered init, refs #16078 fixes #14332 (#16089)
* changelog
* add testcase, fixes #14332
2020-12-03 20:32:18 +01:00
Miran
2220aaeaef add support for parsing chars in scanf macro (#16240) 2020-12-03 17:34:30 +01:00
Aditya Siram
23447ffdce Fixes #16219, hasArgOfName ignoring argument sets. (#16233)
* Fixes #16219, `hasArgOfName` ignoring argument sets.

* Fix test and simplify ident traversal.

* Moved test into a block and removed some boilerplate.

* Fix some argument formatting.

* use ..<

* Change the preceding line too

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-03 13:40:28 +01:00
flywind
849bc36eda merge two parsecfg tests into one (#16237)
* try to fix #16206
* merge two parsecfg tests into one
* Revert "fix"

This reverts commit 668bdec2c4.

* Revert "try to fix #16206"

This reverts commit c399cc2153.
2020-12-03 12:15:36 +01:00
Timothee Cour
e0b4f05053 nimout now consistently uses nimoutCheck (#16189) 2020-12-01 21:12:40 +01:00
Timothee Cour
d29eddf92a experimental/diff: move isMainModule block to tests/stdlib/tdiff.nim (#16172) 2020-11-28 11:59:08 -08:00
Timothee Cour
b809562c7c make megatest consistent with unjoined tests wrt newlines, honor newlines in output spec (#16151)
* fix megatest newlines
* still allow missing trailing newline for now but in a more strict way than before
2020-11-28 09:09:31 +01:00
flywind
bc1db0d6f1 move rest of tests to testament (#16140)
* move rest of tests to testament
* Update tests/stdlib/tsums.nim
2020-11-27 20:47:49 +01:00
flywind
6b77e16c6f tunidecode minor improvement (#16157) 2020-11-27 12:41:22 +08:00
Timothee Cour
3e7077ac7d fix #14339, #13511, #14420: fixes limited VM support for addr (#16002)
* fix #14339: fixes limited VM support for addr

* strengthen test

* reference bug #16003

* also fixes #13511

* also fixes #14420
2020-11-25 20:48:10 +01:00
flywind
cbc793b30b move tests to testament (#16101)
* move tests to testament

* minor

* fix random

* disable test random
2020-11-24 19:06:41 +01:00
flywind
e4d0f9f3de typeinfo minor improvement (#16083)
* typeinfo minor improvement

* minor

* Update lib/core/typeinfo.nim

* rename typeinfo
2020-11-23 22:56:30 +01:00
kemifl
a764a5b9bc fix #14056 (#16071)
fix #14056, incorporate review comments
2020-11-23 19:53:57 +01:00
flywind
0c6c4be0e7 fix ropes format errors (#16106) [backport:1.0]
* fix rope index

* add testcase

* fix ropes format
2020-11-23 19:23:52 +01:00
flywind
ab2c082cb3 fix rope index (#16100)
* fix rope index

* add testcase
2020-11-23 10:27:09 +00:00
flywind
c9371ef59d deques minor improvement (#16084) 2020-11-21 12:30:04 -08:00
flywind
3040f05505 xmltree minor improvement (#16085) 2020-11-21 12:26:51 -08:00
flywind
dd57d46f2f complex minor improvement (#16086) 2020-11-21 12:20:33 -08:00
flywind
f3887dea2c heapqueue minor improvement (#16088) 2020-11-21 12:16:35 -08:00