Commit Graph

593 Commits

Author SHA1 Message Date
Andrey Makarov
fd5c8ef208 RST: implement internal targets (#16614) 2021-01-11 19:51:04 +01:00
flywind
be6e8916fa fix negative nan (#16628) 2021-01-11 11:39:38 +01:00
Timothee Cour
f6c2450cdb fix #16555, fixes #16405: len, high honors '\0' for cstring in vm (#16610) 2021-01-11 10:16:20 +01:00
Antonis Geralis
7bde6aa37f Httpclient improvements (#15919)
* Allow passing Uri instead of strings

* Teach httpclient about 308

* Deprecate request proc where httpMethod is string

* More use of HttpMethod enum

Also fix handling of 308, I forgot to add the hunk to the previous
commit.

* Well behaved redirect handler

* Also remove Transfer-Encoding

* Removed unused proc

* Secure redirection rules

Strip sensitive headers for cross-domain redirects.

* Allow httpMethod to be a string again

This way unknown http verbs can be used without any problem.

* Respect user-specified Host header

* Missed multipart argument.

* Try another method

* add changelog

* Fix hidden deprecation warning, parseEnum failing

* This is wrong

* Have to do it manually, parseEnum is not suitable

* Review comments

* update

Co-authored-by: LemonBoy <thatlemon@gmail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
2021-01-10 13:40:53 +00:00
rockcavera
0da4cb93d1 minor fix (#16624) 2021-01-07 19:16:26 +01:00
PMunch
0e7902b976 Implements streams for sockets (#15729) 2021-01-07 16:09:57 +01:00
flywind
89a21e4ec7 oids: switch from PRNG to random module (#16203)
* switch from PRNG to random module
* fix the regression
* comments + tests
* runnableExamples
* make oids better
2021-01-07 09:38:31 +01:00
flywind
bab0aa6ecf add math.signbit (#16592) 2021-01-07 08:48:02 +01:00
inv2004
04b765c16d Jsonutils: pass opt for object in object (#16615)
* jsonutils: fromJson forward opt param fix

* jsonutils: object in object test + fix: opt pass
2021-01-07 03:09:02 +01:00
inv2004
0d5cab77f6 jsonutils: fromJson forward opt param fix (#16612) 2021-01-06 18:42:49 +01:00
konsumlamm
2c2baa9fad Link the <fenv.h> header (#16597) 2021-01-05 20:51:51 +01:00
flywind
c04f305bf7 make cstrutils work in VM (#16590)
* make cstrutils work in VM

* more
2021-01-05 17:52:26 +01:00
konsumlamm
0c4bd65e8d Improve documentation for complex (#16588)
* Improve documentation for complex

Add missing doc comments

* Add runnableExample

Add links for principal values
Optimize `-`
Change var to let

* Use std prefix for imports
2021-01-05 17:50:15 +01:00
flywind
df9e74b510 fix #9125 (#16582)
* fix #9125

* Update tests/stdlib/tmath.nim

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

* back

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-01-05 17:47:10 +01:00
Clyybber
9f1dd5c00f Make tmath test more strict (#16593)
Don't use approximate equality when comparing
numbers that are representable with perfect precision.
2021-01-05 15:52:24 +01:00
Timothee Cour
b2a53795dc merge tmath_misc.nim into tmath.nim (#16591) 2021-01-05 14:29:21 +01:00
Timothee Cour
00144ee4e9 fix #16576: honor matrix in testament by making such tests non joinable (#16577)
* refs #16576: honor matrix in testament by making such tests non joinable

* add tests + misc fixes

* fix test for i386 with -d:danger
2021-01-04 19:45:46 +01:00
flywind
7c2c1ad072 enable tmath tests for JS backend (#16562) 2021-01-04 11:40:56 +01:00
konsumlamm
435f829348 Improve sequtils documentation (#16559)
* Improve sequtils documentation

Uncomment assertions in tests

* Use present tense
2021-01-04 11:04:30 +01:00
konsumlamm
2eccef7ad6 Algorithm improvements (#16529)
* Improve documentation for algorithm

Remove unused import in algorithm tests
Improve formatting

* Reapply fix for reverse on empty openArray

* Use 3rd person singular

Add more explanations.
2021-01-02 20:28:59 +01:00
flywind
e869767aa7 fix #16061 (#16551) 2021-01-02 17:13:01 +01:00
flywind
b8775bff57 fix is "closure" (#16552) 2021-01-02 17:11:46 +01:00
flywind
d8b1ffc857 fix #16542 (#16549)
* fix #16542
2021-01-02 14:32:37 +01:00
flywind
b5101b23b5 refactor the tests of options (#16527) 2021-01-01 19:01:07 +01:00
flywind
9d4a1f9554 fix #16494 (#16513)
* fix #16494

* fix

* fix

* fix

* fix

* fix

* fix performance

* add comments

* improve performance

* Update lib/system.nim

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

* Update lib/system.nim

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

* Update tests/stdlib/tmath_misc.nim

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

* Update tests/stdlib/tmath_misc.nim

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

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-01-01 10:59:19 +01:00
flywind
5fb56a3b2c refactor cmpIgnoreStyle and cmpIgnoreCase (#16399)
* init

* support strutils

* more

* better

* Call len once per string/cstring

* Change var to let

* Compare ternary on first char

* More appropriate param name

* fix

* better

* one test

* impl

* more efficient

* minor

Co-authored-by: Clyybber <darkmine956@gmail.com>
2020-12-31 11:54:40 +01:00
Andrey Makarov
5984f7a7dd RST: improve line blocks (#16518) 2020-12-31 11:20:04 +01:00
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