summary refs log tree commit diff stats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* only allow enums to overload enums + extra test (#20126)metagn2022-09-031-0/+34
| | | mirror behavior without overloadableEnums
* remove deprecated type pragma syntax, fix bugs that required it (#20199)metagn2022-09-0334-45/+65
| | | | | | | | | | | | | | | | | | | | | | | | * remove deprecated pragma syntax from 0.20.0 closes #4651, closes #16653 with a cheap fix for now due to how early `tfFinal` is set * remove type pragma between name and generics * undo removal, try removing bind expression (0.8.14) * fix test, unremove bind expr * remove again * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * dependencies @ HEAD & weave test dependencies * try fix package ci Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Revert "fix #19600 No error checking on fclose (#19836)" (#20297)ringabout2022-09-021-10/+0
| | | This reverts commit 04e4a5ec0e35fc7e1c346c2d002e8487b4b48cb5.
* Fix #16937; --clib option pass library name to backend C compiler correctly ↵Tomohiro2022-09-013-0/+15
| | | | | | | | | | | | | (#19754) * Fix 16937: Make --clib option works * Make tests/compiler/tcmdlineclib.nim works from any current dir * Try to fix link error on macosx * Add a comment to tests/compiler/tcmdlineclib.nims Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* support cstring in `case` (#20130)metagn2022-09-011-0/+52
| | | | | | | | | | | | | | | * implement case for cstring for now just converts to string on C backend * custom implementation for cstring * remove leftover * revert even more * add nil + fix packages weird variant literal bug * update docs
* [Testament] Extend and document message testing aids (#19996)quantimnot2022-09-0112-63/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [Testament] Extend and document message testing aids * Enable inline msgs when not reject action. Eliminates the pain of changing the line and column numbers in `nimout` or `output` while making changes to the test. * Enable using inline msgs and nimout together. Allows ease of inline msgs for the test as well as testing msgs from other modules. * Add path separator and test filename variable interpolation in msgs. Eases handling path separators in the msgs. * Add some documentation. * Fixed lots of broken tests * Fixed more broken tests * Support multiple inline messages per a line * Fix a broken test * Revert variable substitution in `output` * Remove uneeded params * Update doc/testament.md Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> * Update testament/specs.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> * Update testament/specs.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> * Fix indentation Co-authored-by: quantimnot <quantimnot@users.noreply.github.com> Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* fixes the regressions caused by the fix for #20107 [backport] (#20287)Andreas Rumpf2022-08-312-0/+2
| | | | * fixes the regressions caused by the fix for #20107 [backport]
* fix #19600 No error checking on fclose (#19836)Bung2022-08-291-0/+9
| | | | | * fix #19600 No error checking on fclose * add IOError to open
* Fix auto links to subheader when TOC is present (#20279)Andrey Makarov2022-08-272-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix links to subheader when TOC is present It was observed (in https://github.com/nim-lang/Nim/pull/20112) that links to 2nd- (and subsequent) -level headings fail if TOC is present, e.g.: ```nim .. contents:: Type relations ============== Convertible relation -------------------- Ref. `Convertible relation`_ ``` The problem here is that links are resolved in `rst.nim` but later `rstgen.nim` fixes ("fixes") anchors to make them unique so that TOC always works (if e.g. there was another sub-section like "Convertible relation"). The solution implemented in this PR is to move that fix-up of anchors into `rst.nim`, so that link resolution could know final anchors. The bug seems to be added in https://github.com/nim-lang/Nim/pull/2332 in 2015, that is it is present in Nim 1.0.
* remove unused sfProcvar, "procvar" mentions (#20204)metagn2022-08-241-1/+1
| | | refs #12975. doesn't close it because wProcvar isn't removed
* fixes nimPreviewSlimSystem; register echoBinSafe for nimPreviewSlimSystem ↵ringabout2022-08-241-0/+6
| | | | | | | (#20194) * register echoBinSafe * add output
* fixes #20227; skip distinct types for genObjConstr [JS backend] (#20229)ringabout2022-08-241-0/+17
| | | fixes #20227; skip distinct types for genObjConstr
* test removing dollar for objects out of system (#20242)metagn2022-08-243-0/+20
| | | | | | | | | | | * test removing dollar for objects out of system * test & fixes * fix bootstrap * use nimPreviewSlimSystem, test stdlib category * fix test
* top-down type inference, implements rfc 149 (#20091)metagn2022-08-242-1/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * micro implementation of rfc 149 refs https://github.com/nim-lang/RFCs/issues/149 * number/array/seq literals, more statements * try fix number literal alias issue * renew expectedType with if/case/try branch types * fix (nerf) index type handling and float typed int * use typeAllowed * tweaks + const test (tested locally) [skip ci] * fill out more of the checklist * more literals, change @ order, type conversions Not copying the full call tree before the typedesc call check in `semIndirectOp` is also a small performance improvement. * disable self-conversion warning * revert type conversions (maybe separate op later) * deal with CI for now (seems unrelated), try enums * workaround CI different way * proper fix * again * see sizes * lol * overload selection, simplify int literal -> float * range, new @ solution, try use fitNode for nil * use new magic * try fix ranges, new magic, deal with #20193 * add documentation, support templates Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Add OpenSSL 3 support (#19814)Federico Ceratto2022-08-231-23/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Minor refactor * Add OpenSSL 3 support Remove symbols noOpenSSLHacksq and openssl10 * Drop loading of older openssl versions * Add library path * Use only versioned libssl soname os OSX * Update .github/workflows/ci_packages.yml Co-authored-by: Hein Thant <official.heinthanth@gmail.com> * On Mac OS X CI, link OpenSSL in /usr/local/lib/ * Install OpenSSL on Mac OS X on azure pipeline * Remove DYLD_LIBRARY_PATH Co-authored-by: Hein Thant <official.heinthanth@gmail.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Hein Thant <official.heinthanth@gmail.com>
* new .redefine pragma for templates, warn on redefinition without it (#20211)metagn2022-08-237-8/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test CI for template redefinitions * adapt asyncmacro * fix quote * fix again * try something else * revert * fix ioselectors_select, disable packages CI * adapt more tests & simplify * more * more * more * rename to redefine, warn on implicit redefinition * basic documentation [skip ci] * Update compiler/lineinfos.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* remove some deprecated pre-1.0 stdlib modules (#20202)metagn2022-08-232-98/+1
| | | | | | | | | | | | | | | * remove pre-1.0 stdlib deprecations notable exceptions: * ze, toU8 etc in system/arithmetics * potentially callsite * undo macros, ospaths, securehash, oswalkdir * add sets back * add back future, document deprecated versions * add to changelog [skip ci]
* fixes #18983 #5282 #13008; recursive types casue infinite type (#20172)ringabout2022-08-232-0/+12
| | | | | | | * fixes #18983 #5282 #13008; recursive types casue infinite type * re * add testcases
* remove {.this.} pragma, deprecated since 0.19 (#20201)metagn2022-08-236-81/+25
| | | Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* remove echo statements in tests (part 1) (#20178)ringabout2022-08-239-47/+7
| | | | | | | | | | | * remove echo statements * Update tests/vm/triangle_array.nim * Update tests/vm/tyaytypedesc.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* remove a special case in sigmatch; distinct pointer types no longer match ↵ringabout2022-08-232-13/+28
| | | | | | | | | | | | | | | | `nil` type (#20251) * remove a special case in sigmatch; distinct pointer types no longer match `nil` type * add tests * fixes tests * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* fixes #19967; reset does not work on set [backport: 1.2] (#19968)ringabout2022-08-231-0/+27
| | | | | | | | | | | | | * fixes #19967 * use case * add testcase * fix typos * explictly specify other branches Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* fixes #20162; locals doesn't work with ORC [backport] (#20163)ringabout2022-08-231-0/+1
| | | fixes #20162; locals doesn't work with ORC
* fixes #11953; jsondoc creates no files unless the htmldocs dir is created ↵ringabout2022-08-201-0/+16
| | | | | | | | | (#20198) * fixes #11953; jsondoc creates no files unless the htmldocs dir is created * target * fixes runner
* Add use of Windows Wide CRT API for env. vars (#20084)havardjohn2022-08-203-7/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add use of Windows Wide CRT API for env. vars Replaces use of CRT API `getenv` and `putenv` with respectively `_wgetenv` and `_wputenv`. Motivation is to reliably convert environment variables to UTF-8, and the wide API is best there, because it's reliably UTF-16. Changed the hack in `lib/std/private/win_setenv.nim` by switching the order of the Unicode and MBCS environment update; Unicode first, MBCS second. Because `_wgetenv`/`_wputenv` is now used, the Unicode environment will be initialized, so it should always be updated. Stop updating MBCS environment with the name of `getEnv`. It's not necessarily true that MBCS encoding and the `string` encoding is the same. Instead convert UTF-16 to current Windows code page with `wcstombs`, and use that string to update MBCS. Fixes regression in `6b3c77e` that caused `std/envvars.getEnv` or `std/os.getEnv` on Windows to return non-UTF-8 encoded strings. Add tests that test environment variables with Unicode characters in their name or value. * Fix test issues Fixes * `nim cpp` didn't compile the tests * Nimscript import of `tosenv.nim` from `test_nimscript.nims` failed with "cannot importc" * Fix missing error check on `wcstombs` * Fix ANSI testing errors * Separate ANSI-related testing to their own tests, and only executing them if running process has a specific code page * Setting locale with `setlocale` was not reliable and didn't work on certain machines * Add handling of a "no character representation" error in second `wcstombs` call * tests/newruntime_misc: Increment allocCount Increments overall allocations in `tnewruntime_misc` test. This is because `getEnv` now does an additional allocation: allocation of the UTF-16 string used as parameter to `c_wgetenv`. * Revert "tests/newruntime_misc: Increment allocCount" This reverts commit 4d4fe8bd3edb1bfc6d600f247af797c7552f5477. * tests/newruntime_misc: Increment allocCount on Windows Increments overall allocations in `tnewruntime_misc` test for Windows. This is because `getEnv` on Windows now does an additional allocation: allocation of the UTF-16 string used as parameter to `c_wgetenv`. * Refactor, adding suggestions from code review Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> * Document, adding suggestions Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* fixes #20149; fixes #16762; hintAsError and warningAsError now ignore ↵ringabout2022-08-192-0/+8
| | | | | | | | | | | | | | | | | | | foreign packages (#20151) * fixes #20149; hintAsError/warningAsError ignores foreign packages * add changelog * fixes the test * remove * fixes tests again * fix * I'm careless Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
* fixes #20107 (#20246) [backport]Andreas Rumpf2022-08-191-0/+24
|
* Don't require blank line before Markdown code (#20215)Andrey Makarov2022-08-152-2/+41
| | | | Fixes bug reported in https://github.com/nim-lang/Nim/pull/20189 affecting nimforum.
* closes #12955; add testcase (#20223)ringabout2022-08-152-0/+7
|
* closes #15316; add testcase (#20213)ringabout2022-08-132-0/+7
|
* closes #6559; add testcase (#20200)ringabout2022-08-121-0/+17
|
* fixes broken ssl tests (#20181)ringabout2022-08-091-2/+2
|
* fixes #20153; do not escape `_` for mysql [backport] (#20164)ringabout2022-08-051-0/+4
| | | | | | | | | | | * fixes #20153; do not escape `_` for mysql * add a test * Update db_mysql.nim * Update tdb_mysql.nim Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
* fixes #20132; fixes the broken jsondoc comand [backport] (#20135)ringabout2022-08-042-0/+28
| | | | | * fixes #20132; fixes the broken jsondoc comand * add testcase
* Revert "enable nimPreviewDotLikeOps" (#19919)ringabout2022-08-032-1/+1
| | | | | | | | | * Revert "enable nimPreviewDotLikeOps (#19598)" This reverts commit 6773ffa63d0b3ab8b8894e84ed417f4eaced9122. * add deprecated message Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
* Fixed compilation of void closureiters with try stmt (#20138) [backport]Yuriy Glukhov2022-08-031-0/+8
|
* Highlight Nim default in Markdown code in .nim (#20110)Andrey Makarov2022-07-312-2/+12
| | | Highlight Nim by default in Markdown code in .nim
* fixes #20031; uint64 is an ordinal type since 1.0 (#20094)ringabout2022-07-271-0/+11
| | | | | * fixes #20031; uint64 is an ordinal type since 1.0 * Update compiler/semstmts.nim
* remove shallowCopy for ARC/ORC (#20070)ringabout2022-07-261-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | * remove shallowCopy for ARC/ORC * use move * fix * more fixes * typo * Update lib/system.nim * follow * add nodestroy * move * copy string * add a changelog entry Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* fixes #20089; remove setPointer since strings/seqs are not pointers with ORC ↵ringabout2022-07-261-0/+14
| | | | | (#20090) fixes #20089; remove setPointer since strings/seqs are not pointers anymore
* .forbids pragma: defining forbidden tags (#20050)Lancer112112022-07-269-0/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * .forbids pragma: defining illegal effects for proc types This patch intends to define the opposite of the .tags pragma: a way to define effects which are not allowed in a proc. * updated documentation and changelogs for the forbids pragma * renamed notTagEffects to forbiddenEffects * corrected issues of forbids pragma the forbids pragma didn't handle simple restrictions properly and it also had issues with subtyping * removed incorrect character from changelog * added test to cover the interaction of methods and the forbids pragma * covering the interaction of the tags and forbids pragmas * updated manual about the forbids pragma * removed useless statement * corrected the subtyping of proc types using the forbids pragma * updated manual for the forbids pragma * updated documentations for forbids pragma * updated nim docs * updated docs with rsttester.nim * regenerated documentation * updated rst docs * Update changelog.md Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com> * updated changelog * corrected typo Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* Markdown code blocks part 2; migrate Nim Manual (#20080)Andrey Makarov2022-07-252-10/+28
| | | | | * Change headings underscored by `~~~` to `###` * Markdown code blocks part 2; migrate Nim Manual
* fix #20067, fix #18976 [backport] (#20069)metagn2022-07-221-0/+28
|
* defines the `gcRefc` symbol which allows writing specific code for refc (#20009)flywind2022-07-171-1/+6
| | | | | | | | | | | | | | | | | | * define gcRefc symbols * add comments * add a changelog item * Update changelog.md Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update changelog.md Co-authored-by: Yardanico <tiberiumk12@gmail.com> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Yardanico <tiberiumk12@gmail.com>
* Improve Markdown code blocks & start moving docs to Markdown style (#19954)Andrey Makarov2022-07-153-11/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add additional parameters parsing (other implementations will just ignore them). E.g. if in RST we have: .. code:: nim :test: "nim c $1" ... then in Markdown that will be: ```nim test="nim c $1" ... ``` - implement Markdown interpretation of additional indentation which is less than 4 spaces (>=4 spaces is a code block but it's not implemented yet). RST interpretes it as quoted block, for Markdown it's just normal paragraphs. - add separate `md2html` and `md2tex` commands. This is to separate Markdown behavior in cases when it diverges w.r.t. RST significantly — most conspicously like in the case of additional indentation above, and also currently the contradicting inline rule of Markdown is also turned on only in `md2html` and `md2tex`. **Rationale:** mixing Markdown and RST arbitrarily is a way to nowhere, we need to provide a way to fix the particular behavior. Note that still all commands have **both** Markdown and RST features **enabled**. In this PR `*.nim` files can be processed only in Markdown mode, while `md2html` is for `*.md` files and `rst2html` for `*.rst` files. - rename `*.rst` files to `.*md` as our current default behavior is already Markdown-ish - convert code blocks in `docgen.rst` to Markdown style as an example. Other code blocks will be converted in the follow-up PRs - fix indentation inside Markdown code blocks — additional indentation is preserved there - allow more than 3 backticks open/close blocks (tildas \~ are still not allowed to avoid conflict with RST adornment headings) see also https://github.com/nim-lang/RFCs/issues/355 - better error messages - (other) fix a bug that admonitions cannot be used in sandbox mode; fix annoying warning on line 2711
* fix #20002 (#20004)metagn2022-07-151-0/+8
| | | | | | While this fix seems innocent, this unlocks the hidden behavior of method calls not being able to call gensym'ed routines inside templates.
* [Orc] fixes "streams.readDataStr segafaults" when accepting a string ↵flywind2022-07-151-0/+10
| | | | | literal (#20019) [backport] fixes streams.readDataStr accept a string literal
* fix #20012 (#20013)Daniel Clarke2022-07-131-0/+15
| | | | | | | * replace gcc asm with __asm__ and add a test * update test case to specify gcc or clang and not cpp Co-authored-by: daniel <danielclarke@wearepopgun.com>
* allow dots in defined() (#20010)metagn2022-07-121-2/+17
| | | | | | | * allow dots in defined() refs https://github.com/nim-lang/RFCs/issues/181 * mention accents in older versions
* Fix nested finally handling in closureiters [backport] (#19933)Tanguy2022-07-111-0/+75
| | | | | | | | | | | | | | | * Fix nested finally handling in closureiters * Fix CI * review comment * third time the charm * Update compiler/closureiters.nim Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com> Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>