summary refs log tree commit diff stats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Allow full commands and blocks in type sections (#19181)hlaaftana2022-01-025-0/+368
| | | | | | | * allow full commands and blocks in type sections * update grammar * fix changelog [skip ci] * more tests * even more tests
* Update JS and nimscript import tests (#19306)hlaaftana2022-01-012-40/+53
| | | | | * add new modules, except experimental ones * remove deprecated modules mersenne and sharedlist * better describe why some modules fail and some modules don't
* 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.
* Fixed object field access of static objects in generics (#19283) [backport]Jason Beetham2021-12-231-0/+8
|
* 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>
* nimRawSetjmp: support Windows (#19197)Ștefan Talpalaru2021-12-102-2/+134
| | | | | | | | | | | | * nimRawSetjmp: support Windows Using `_setjmp()` directly is required to avoid some rare (but very annoying) exception-related stack corruption leading to segfaults on Windows, with Mingw-w64 and SEH. More details: https://github.com/status-im/nimbus-eth2/issues/3121 Also add "nimBuiltinSetjmp" - mostly for benchmarking. * fix for Apple's Clang++
* fixes an old ARC bug: the produced copy/sink operations don't copy the ↵Andreas Rumpf2021-12-091-0/+15
| | | | hidden type field for objects with enabled inheritance; fixes #19205 [backport:1.6] (#19232)
* fixes a converter handling regression that caused private converters to leak ↵Andreas Rumpf2021-12-092-0/+13
| | | | into client modules; fixes #19213; [backport:1.6] (#19229)
* allow `HSlice` bounded by constants of distinct types (#19219) [backport:1.2]Etan Kissling2021-12-061-0/+2
| | | | | | | | | When creating heterogenous slices of distinct types, the compiler does not initialize the internal type's `size` before accessing it. This then leads to this crash message: ``` compiler/int128.nim(594, 11) `false` masking only implemented for 1, 2, 4 and 8 bytes [AssertionError] ``` This patch initializes the `size` properly, fixing the problem.
* treat do with pragmas but no parens as proc (#19191)hlaaftana2021-12-051-2/+17
| | | fixes #19188
* fixes #19159 [backport:1.6] (#19210)Andreas Rumpf2021-12-041-0/+12
|
* fixes #19198 [backport:1.6] (#19209)Andreas Rumpf2021-12-041-2/+21
| | | | | * fixes #19198 [backport:1.6] * added a test case
* fixes #19015 [backport:1.6] (#19204)Andreas Rumpf2021-12-041-0/+3
|
* accept object type node from macros (#19179)hlaaftana2021-11-241-0/+16
|
* parseExpr/parseStmt accept filename, fixes #13540 (#19182)hlaaftana2021-11-242-0/+15
|
* fix #12274 (#19180)hlaaftana2021-11-241-0/+9
|
* `caseStmtMacros` no longer experimental, experimental manual refactor (#19173)hlaaftana2021-11-231-2/+0
| | | | | | | | | | | * `caseStmtMacros` no longer experimental, experimental manual refactor * Update doc/manual.rst * apply review suggestions * apply review Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* implement RST & Markdown quote blocks (#19147)Andrey Makarov2021-11-231-0/+361
| | | | | | | * implement RST & Markdown quote blocks * compile with nim 1.0 * Fix indentation
* Accept nnkTypeSection from typedef macro pragmas (#19168)hlaaftana2021-11-221-0/+66
|
* fix marshal bugs in VM (#19161) [backport:1.6]flywind2021-11-171-4/+8
|
* Enable customizing PageShift to set PageSize for embedded targets (#19129)Jaremy Creechley2021-11-161-2/+5
| | | | | | | | | | | | | | | | * Enable customizing PageSize (via PageShift). This enables adjusting PageSize for embedded targets without abusing cpu16. * copy nimPageXYZ settings for mmpaptest * add docs for Nim manual * add docs for Nim manual * docs tweaks Co-authored-by: Jaremy Creechley <jaremy.creechley@panthalassa.com>
* 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>
* fixes #19051 [backport:1.6] (#19133)Andreas Rumpf2021-11-121-1/+8
|
* fixes #19013 [backport:1.6] (#19111)Andreas Rumpf2021-11-091-0/+22
| | | | | * fixes #19013 [backport:1.6] * added test case
* change os.nim doc links to new style (#19102)Andrey Makarov2021-11-081-0/+6
|
* fixes another effect inference bug [backport:1.6] (#19100)Andreas Rumpf2021-11-072-0/+64
| | | | * fixes another effect inference bug [backport:1.6]
* manual: Document that comma propagates the default values of parameters (#19080)Kaushal Modi2021-11-031-0/+20
| | | | | | | | | | | | | * manual: Document that comma propagates the default values of parameters Fixes https://github.com/nim-lang/Nim/issues/15949. * Use the "bug #NNNN" comment syntax for consistency Ref: https://nim-lang.github.io/Nim/contributing.html#writing-tests-stdlib > Always refer to a GitHub issue using the following exact syntax: bug for tooling.
* manual: Document the use of `static` as a proc call (#19084)Kaushal Modi2021-11-032-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | * manual: Document the use of `static` as a proc call Also adds tests. Fixes https://github.com/nim-lang/Nim/issues/16987 . * Update doc/manual.rst Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Use the "bug #NNNN" comment syntax for consistency Ref: https://nim-lang.github.io/Nim/contributing.html#writing-tests-stdlib > Always refer to a GitHub issue using the following exact syntax: bug for tooling. * manual: Undocument usage of foo.static foo.static and foo.static() are not expected to work. Ref: https://github.com/nim-lang/Nim/pull/19084/files#r741203578 Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Add test for issue 15435 (#19079)Kaushal Modi2021-11-031-0/+29
| | | | | | | | | * Add test for issue 15435 Closes https://github.com/nim-lang/Nim/issues/15435. * Specify bug # in comment Addresses https://github.com/nim-lang/Nim/pull/19079#discussion_r740279547
* 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 #18410 (Errors initializing an object of RootObj with the C++ backend) ↵flywind2021-10-312-1/+17
| | | | | | | | | | | | | [backport] (#18836) * fix #18410 * one line comment * typo * typo * cover cpp
* fix #18971 (#19070) [backport:1.6]Derek 呆2021-10-291-0/+10
| | | | since the example code return value from global variable, instead of first argument, the `n.len` is 1 which causes compiler crashes.
* 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
|
* Fixed distinct composite type class proc borrowing (#18904)Jason Beetham2021-10-261-0/+32
| | | | | | | * Fixed composite type class proc borrowing * Moved borrow search into transf * added borrow check to symbol flag
* Fixed generic distinct conversions for 'var' (#18837)Jason Beetham2021-10-262-0/+23
| | | | | | | | | | | | | | | * SameTypeAux now properly traverses generic distincts * Smarter traversal of distincts * Removed redundant check * Fixed nkConv for jsgen * Added test for non distinct nkConv * using skiptypes for distinct now * Fixed genaddr for nkconv
* 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>
* remove exception (#18906)flywind2021-10-221-0/+7
|
* 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
* try to fix broken ssl test (#18991)Miran2021-10-141-1/+1
|