summary refs log tree commit diff stats
path: root/tests/stdlib
Commit message (Collapse)AuthorAgeFilesLines
* Removed deprecated httpcore func (#19550)Juan Carlos2022-03-181-4/+4
| | | | | | | | | * Remove Deprecated httpcore func * Remove Deprecated httpcore func * Fix a test with Deprecated func * Restart CI, Apple can code shit anymore I tell you
* enable nimPreviewDotLikeOps (#19598)flywind2022-03-091-0/+1
|
* register callback for marshal in VM (#19578)flywind2022-03-081-6/+36
| | | | | | | | | | | | | * register callback for marshal in VM * remove unrelated code * polish * more tests * more tests * add loadVM and toVM
* Remove deprecated math.c_frexp (#19518)Juan Carlos2022-02-141-6/+0
| | | | | | | * Remove Deprecated math proc * Remove Deprecated math proc * Remove Deprecated math proc
* use OrderedTable instead of OrderedTableRef for mimedb (#19522)David Krause2022-02-141-0/+2
| | | | | | | | | * use OrderedTable instead of OrderedTableRef for mimedb Signed-off-by: David Krause <enthus1ast@users.noreply.github.com> * added changelog entry for mimedb change Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>
* Fix bug 27 of #17340 (#19433)Andrey Makarov2022-02-072-8/+30
| | | | | | Fixes silent disappearance of Markdown (pseudo-)link when it's detected as unsafe protocol. Now it will be converted to plain text in spirit of [the specification](https://spec.commonmark.org/0.30/#links). For that sake the check for protocol is added to rst.nim also.
* fix parseEnum cannot parse enum with const fields (#19466)flywind2022-02-041-0/+11
| | | fix #19463
* fix broken CI (#19472)flywind2022-01-311-6/+6
| | | | | | | * fix broken CI * fix * fix tests
* Merge pull request from GHSA-ggrq-h43f-3w7mDominik Picheta2022-01-291-7/+38
| | | | This fixes a CVE (currently https://github.com/nim-lang/Nim/security/advisories/GHSA-ggrq-h43f-3w7m)
* New/better macro pragmas, mark some as experimental (#19406)metagn2022-01-201-54/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * New/better macro pragmas, make some experimental fix #15920, close #18212, close #14781, close #6696, close https://github.com/nim-lang/RFCs/issues/220 Variable macro pragmas have been changed to only take a unary section node. They can now also be applied in sections with multiple variables, as well as `const` sections. They also accept arguments. Templates now support macro pragmas, mirroring other routine types. Type and variable macro pragmas have been made experimental. Symbols without parentheses instatiating nullary macros or templates has also been documented in the experimental manual. A check for a redefinition error based on the left hand side of variable definitions when using variable macro pragmas was disabled. This nerfs `byaddr` specifically, however this has been documented as a consequence of the experimental features `byaddr` uses. Given how simple these changes are I'm worried if I'm missing something. * accomodate compiler boot * allow weird pragmas * add test for #10994 * remove some control flow, try remove some logic
* Resolve cross file resolution errors in atomics (#19422) [backport:1.6]James2022-01-202-0/+20
| | | | | * Resolve call undeclared routine testAndSet * Fix undeclared field atomicType
* Added `std/envvars` for env vars handling (#19421)flywind2022-01-201-0/+59
|
* Added `std/oserrors` for OS error reporting (#19390)flywind2022-01-171-0/+9
| | | | | | | | | * Added 'std/oserrors' for OS error reporting * add a simple test * New code should not support -d:useWinAnsi anymore thanks to @Araq
* deprecate unsafeAddr; extend addr (#19373)flywind2022-01-163-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | * deprecate unsafeAddr; extend addr addr is now available for all addressable locations, unsafeAddr is deprecated and become an alias for addr * follow @Vindaar's advice * change the signature of addr * unsafeAddr => addr (stdlib) * Update changelog.md * unsafeAddr => addr (tests) * Revert "unsafeAddr => addr (stdlib)" This reverts commit ab83c99c507048a8396e636bf22d55fdd84d7d1c. * doc changes; thanks to @konsumlamm Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Use openarray of bytes in md5 (#19307)hlaaftana2022-01-151-5/+14
| | | | | | | | | | * Use openarray of bytes in md5 * fix CI * cleanup * use noSideEffect for bootstrapping * fix CI again * actually fix CI by checking if it works * this is getting ridiculous * put old md5 version in compiler, remove vmop
* Fix `remove` on last node of singly-linked list [backport:1.6] (#19353)gecko2022-01-101-0/+13
|
* style usages part one (openarray => openArray) (#19321)flywind2022-01-043-5/+5
| | | | | * style usages (openArray) * revert doc changes
* Fix #19314 - fixing broken `DoublyLinkedList` after adding empty ↵rockcavera2022-01-031-0/+12
| | | | | | | `DoublyLinkedList` (#19315) [backport] * Update lists.nim * Update tlists.nim
* Add Week-Of-Year Implementation to Times Module (#17223)Carlo Capocasa2022-01-031-0/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * initial * more tests * Apply suggestions from code review idiomatize Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * test iron age dates * add examples * fix typo * consistent param mention * add since pragrams * add changelog * Update lib/pure/times.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * fix examples * fix negative years * add getWeeksInYear tests * add back fix dropped by rebase * week-year tuple api * add changelog * fix doc tags * add docstrings * fix typos Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Fix #19297 - fixing broken list after adding empty list (#19299)rockcavera2021-12-301-0/+12
| | | | | | | | | * Update lists.nim * Update tlists.nim * removed check `if b.tail != nil` The tail of the list being null it is still possible to retrieve its end by going through all nodes from the head. So checking for null from `b.tail` is unnecessary. However, setting `a.tail = b.tail` only if `a.head != nil`, so you don't break a good list with an already broken one.
* Extract runnables that specify `doccmd` (#19275) [backport:1.6]Jake Leahy2021-12-201-0/+20
|
* fix #19244 - solves the problem of the InAddr object constructor in Windows. ↵rockcavera2021-12-171-0/+6
| | | | | | | (#19259) * Update winlean.nim * Update tnet_ll.nim
* [backport:1.0] json: limit recursion depth (#19252)Miran2021-12-141-0/+32
| | | | | * json: limit recursion depth * do not run this check for JS backend
* fix: fixes bug in CVerifyPeerUseEnvVars (#19247)Nick Wilburn2021-12-141-0/+16
| | | | | | Previously CVerifyPeerUseEnvVars was not being passed into scanSslCertificates, which meant that we weren't scanning additional certificate locations given via the SSL_CERT_FILE and SSL_CERT_DIR environment variables
* fix bug #14468 zero-width split (#19248)Carlo Capocasa2021-12-131-0/+6
|
* Various std net improvements (#19132)Jaremy Creechley2021-12-121-43/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Variant of that works with raw IpAddresses. - Add doc tests for new net proc's. - Aadd recvFrom impl - Add recvFrom impl -- tweak handling data var - Update lib/pure/net.nim Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com> - cleaning up sendTo args - remove extra connect test - cleaning up sendTo args - fix inet_ntop test - fix test failing - byte len * fix test failing - byte len * debugging odd windows build failure * debugging odd windows build failure * more experiments to figure out the windows failure * try manual assigment on InAddr Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* fixes a possible 'javascript:' protocol exploit [backport:1.0] (#19134)Andreas Rumpf2021-12-101-4/+31
| | | | | | | | | | | | | * fixes a possible 'javascript:' protocol exploit [backport:1.0] * add tests * Update tests/stdlib/trstgen.nim * add the same logic for hyperlinks * move the logic into a proc Co-authored-by: narimiran <narimiran@disroot.org>
* implement RST & Markdown quote blocks (#19147)Andrey Makarov2021-11-231-0/+361
| | | | | | | * implement RST & Markdown quote blocks * compile with nim 1.0 * Fix indentation
* Fix punycode.decode function (#19136)Christoph Krybus2021-11-121-1/+201
| | | | | | | | | | | | | | * Refactor: rename proc to func * Fix punycode.decode function This function could only properly decode punycodes containing a single encoded unicode character. As soon as there was more than one punycode character group to decode it produced invalid output - the number of characters was correct, but their position was not. * Update tpunycode.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* change os.nim doc links to new style (#19102)Andrey Makarov2021-11-081-0/+6
|
* tests: Fix warnings in tstrscans (#19082)Kaushal Modi2021-11-021-26/+34
|
* Fix VM's sametype impl to work for generics/typedescs (#19073)Jason Beetham2021-11-021-0/+58
| | | | | | | * Fix vm's sametype implementation to properly handle generics and typedescs * actually fixed sametype + have test * added comments and removed unsafe code
* Fix nimIdentNormalize, fixes #19067 (#19068)Tomasz Kramkowski2021-10-291-0/+7
| | | | | | | * Make nimIdentNormalize return "" when passed ""; fixes #19067 Fixes #19067 * Add tests for nimIdentNormalize
* docgen: implement doc link resolution in current module (#18642)Andrey Makarov2021-10-283-15/+268
|
* Add Zephyr Support (#19003)Jaremy Creechley2021-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * fixing PR issues * Porting Nim to run on Zephyr. Includes changes to `std/net`. Squashed commit of the following: tweaking more memory / malloc things revert back bitmasks tweaking nim to use kernel heap as C malloc doesn't work fixing socket polling on zephyr cleanup getting maximum sockets for process or for rtos'es reorganizing and fixing net for async / system merge netlite changes back into nativesockets merge netlite changes back into nativesockets reverting native sockets back tweaking nim / zephyr network adding option to run 'net-lite' from linux bridging zephyr's max connections fixing net errors fixing compilation with getAddrString fixing compilation with getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getAddrString experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... getLocalAddr experimenting with a nativesockets_lite ... add note regarding incorrect FreeRTOS Sockadd_in fields changing to NIM_STATIC_ASSERT cleaning up the static_assert error messages cleaning up the static_assert error messages setting up static assert ftw! testing compile time asserts reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms reworking Sockaddr objects to more closely match various platforms finding missing items (issue #18684) fixup posix constants (issue #18684) adding plumbing for zephyr os (issue #18684) adding plumbing for zephyr os (issue #18684) * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * Remerge * fixing constant capitalizations * remove extra debug prints and fix TSa_Family/cint issue * remove extra debug prints and fix TSa_Family/cint issue * fixing PR issues * fix maxDescriptors on zephyr/freertos * move maxDescriptors to selector.nim -- fixes compile issue * change realloc impl on zephyr to match ansi c behavior * change realloc impl on zephyr to match ansi c behavior * force compileOnly mode for tlwip Co-authored-by: Jaremy J. Creechley <jaremy.creechley@wavebaselabs.com> Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* fix parsesql.treeRepr when nil is in input (#18974)Andrey Makarov2021-10-171-0/+34
| | | | | * fix parsesql.treeRepr when nil is in input * return newNode(nkNone) as default value, not nil
* sequtils: fix errors from `strictFuncs` use (#18998)ee72021-10-161-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nim 1.4.x compiled the below code without error when using `--experimental:strictFuncs` import std/sequtils type Foo = ref object let foo1 = Foo() let foo2 = Foo() let foos = @[foo1, foo2] let fooTuples = @[(foo1, 1), (foo2, 2)] discard repeat(foo1, 3) discard zip(foos, foos) discard unzip(fooTuples) However, since 2020-12-09, devel Nim produced errors like /tmp/bar.nim(11, 15) template/generic instantiation of `repeat` from here /foo/nim/pure/collections/sequtils.nim(172, 6) Error: 'repeat' can have side effects an object reachable from 'x' is potentially mutated /foo/nim/pure/collections/sequtils.nim(183, 15) the mutation is here /foo/nim/pure/collections/sequtils.nim(183, 15) is the statement that connected the mutation to the parameter This commit reverts some `proc` to `func` changes so that code that: - calls `repeat`, `zip`, or `unzip` - and instantiates them with types containing `ref` can once again be compiled with `strictFuncs`. Otherwise, a user might be forced to drop or alter their `strictFuncs` use when upgrading from Nim 1.4.x, or when writing new code that uses these procedures (at least for now, with the current `strictFuncs` implementation). This commit also adds tests to assert that the remaining funcs in this module can be compiled with `strictFuncs` when used with types containing `ref`. The original batch of `proc` to `func` changes in `sequtils.nim` was in commit 6f57ebae349f, which was partially reverted in 38eb021f8158. See also: https://github.com/nim-lang/Nim/issues/16305
* rst: minor fixes (#18960)Andrey Makarov2021-10-061-1/+1
|
* rename nimEnableHashRef [backport] (#18941)flywind2021-10-041-1/+0
| | | | | | * rename nimEnableHashRef [backport] * Apply suggestions from code review Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Add support for `strictEffects` to `std/pegs` (#18949)quantimnot2021-10-041-0/+3
| | | | | | | * Add support for `strictEffects` to `std/pegs` * Fixed support of older Nim versions Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* envPairs works in vm, nims (#18615)Timothee Cour2021-09-291-8/+10
| | | | | * envPairs works in vm, nims * fixup
* fix #18844 (#18851)flywind2021-09-201-1/+21
|
* remove channels (#18801)flywind2021-09-043-422/+0
| | | | | * remove channels * test
* sequtils now support strict effect tracking (#18782)Andreas Rumpf2021-09-021-0/+5
|
* Fix initrand to avoid random number sequences overlapping (#18744)Tomohiro2021-09-021-4/+28
| | | | | | | | | | | | | | | | | | | | | | | * Fix initrand to avoid random number sequences overlapping * Minor fix * Fix compile error on js backend * Disable new test for js backend * Minor fix * tempfiles module uses random.initRand() * Remove unused module import from lib/std/tempfiles.nim * Initialize baseState in initRand() * Run tests/stdlib/trandom.nim from tests/test_nimscript.nims * baseState is initialized only with sysrand.urandom and quit if failed * Add comments
* strict effects (#18777)Andreas Rumpf2021-09-021-17/+14
| | | | | | | | | | | | | | | | | * fixes #17369 * megatest is green for --cpu:arm64 * docgen output includes more tags/raises * implemented 'effectsOf' * algorithm.nim: uses new effectsOf annotation * closes #18376 * closes #17475 * closes #13905 * allow effectsOf: [a, b] * added a test case * parameters that are not ours cannot be declared as .effectsOf * documentation * manual: added the 'sort' example * bootstrap with the new better options
* fix #9778 (pairs iterator calling a helper proc with tuple return type will ↵flywind2021-09-021-0/+256
| | | | | | | | | | | cut the iterator yield into half) (#18767) * test someSymFromImportTable * Update compiler/lookups.nim * test nkTupleConstr * use isConstExpr * add tests * add comments and todo * use todo
* Fix #18718 (#18731)konsumlamm2021-08-231-42/+51
| | | Update tests
* Add ceilDiv to math (#18596)Tomohiro2021-08-191-0/+40
| | | | | | * Use assert in runnableExamples and improve boundary check * Add more tests for ceilDiv * Fix comment in ceilDiv * Calling ceilDiv with int type T such like sizeof(T) > 8 is error
* fix #18702(fix `parseutils.parseFloat`) (#18703) [backport:1.0]flywind2021-08-161-2/+11
| | | | | * fix #18702 * Apply suggestions from code review