summary refs log tree commit diff stats
path: root/tests/effects
Commit message (Collapse)AuthorAgeFilesLines
* fixes #23129; fixes generated hooks raise unlisted Exception, which never ↵ringabout2024-01-111-0/+16
| | | | | raise (#23195) fixes #23129
* Also show the `raises` pragma when converting proc types to string (#23026)Nikolay Nikolov2023-12-041-1/+1
| | | | This affects also nimsuggest hints (e.g. on mouse hover), as well as compiler messages.
* fixes #22254; fixes #22253; stricteffects bugs on recursive calls (#22294)ringabout2023-07-191-0/+11
|
* Fix: don't track Defect in proc effect compatibility (#22037)Tanguy2023-06-081-0/+5
|
* some test cleanups & category reorganization (#22010)metagn2023-06-061-28/+0
| | | | | | | | | | | | | | | | | * clean up some test categories * mention exact slice issue * magics into system * move trangechecks into overflow * move tmemory to system * try fix CI * try fix CI * final CI fix
* fixes #19863; move sha1, md5 to nimble packages for 2.0 (#21702)ringabout2023-05-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * move sha1, md5 to nimble packages * boot the compiler * fixes tests * build the documentation * fixes docs * lol, I forgot koch.nim * add `nimHasChecksums` define * clone checksums but maybe copying is better * bump nimble hash * use ChecksumsStableCommit * fixes tests * deprecate them * fixes paths * fixes koch
* fixes #21393 and misc style changes (#21419)Andreas Rumpf2023-02-241-1/+1
| | | | | | | | | * fixes #21393 and misc style changes * progress --------- Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* closes #20808 (#21077)Andreas Rumpf2022-12-121-0/+35
|
* alternative, much simpler algorithm for strict func checking (#21066)Andreas Rumpf2022-12-114-15/+72
| | | | | | | | | | | | | * alternative, much simpler algorithm for strict func checking * forgot to git add new compiler module * new spec is incredibly simple to describe * fixes bigints regression * typos * closes #16305; closes #17387; closes #20863
* build the documentation of official packages (#20986)ringabout2022-12-061-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove db stuffs * remove punycode * remove * fixes script * add cloner * patches * disable * patch * fixes external packages * disable two packages * preview documentation build * try again * fixes URL * fixes a bug * simplify * fixes documentaion * fixes * Apply suggestions from code review
* Named arguments in commands + many grammar fixes (#20994)metagn2022-12-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Breaking parser changes, implement https://github.com/nim-lang/RFCs/issues/442 Types are separated from expressions and better reflected in the grammar. * add test * more accurate grammar * fix keyword typedescs * accept expressions in proc argument lists * CI "fixes" * fixes * allow full ref expressions again, adapt old tests * cleanup, fix some tests * improve grammar, try and revert semtypes change * restrict sigil binding to identOrLiteral * fix, should have caught this immediately * add changelog entry, fix double not nil bug * correct grammar * change section * fix * real fix hopefully * fix test * support LL(1) for tuples * make grammar.txt too
* move `smtp` to nimble packages (#20953)ringabout2022-11-301-1/+0
| | | | | | | | | * move `smtp` to nimble packages * fixes * install smtp * yes
* move `asyncftpclient` to nimble packages (#20952)ringabout2022-11-281-1/+0
|
* add a testcase for laxeffects (#20750)ringabout2022-11-041-0/+11
|
* closes #14216; add testcase (#20733)ringabout2022-11-021-0/+39
|
* fixes a strict case object problem that has been reported on the forum (#20614)Andreas Rumpf2022-10-211-1/+21
|
* implemented strictCaseObjects (#20608)Andreas Rumpf2022-10-211-0/+27
| | | | | * implemented strictCaseObjects * changelog update
* fixes #19162; enable `strictEffects` for v2 (#19380)ringabout2022-10-153-4/+4
| | | | | | | | | | | | | | | | | | | * enable stricteffects * add gcsafe * fix tests * use func * fixes pegs tests * explicitly mark repr related procs with noSideEffect * add nimLegacyEffects * change URL * fixes docopt * add `raises: []` to repr * fixes weave * fixes nimyaml * fixes glob * fixes parsetoml * Apply suggestions from code review * Update testament/important_packages.nim * add legacy:laxEffects
* 'lock levels' are deprecated, now a noop (#20539)ringabout2022-10-114-4/+4
| | | | | * 'lock levels' are deprecated, now a noop * fixes tests
* move widestrs out of system (#20462)metagn2022-10-011-0/+9
| | | | | * move widestrs out of system * fix osproc
* fix #2614 improve error message when array of proc calling convention… ↵Bung2022-09-261-3/+4
| | | | | (#20379) fix #2614 improve error message when array of proc calling convention mismatch
* remove deprecated type pragma syntax, fix bugs that required it (#20199)metagn2022-09-033-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | * 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>
* [Testament] Extend and document message testing aids (#19996)quantimnot2022-09-011-10/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * [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>
* closes #6559; add testcase (#20200)ringabout2022-08-121-0/+17
|
* .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>
* fixes #19159 [backport:1.6] (#19210)Andreas Rumpf2021-12-041-0/+12
|
* fixes another effect inference bug [backport:1.6] (#19100)Andreas Rumpf2021-11-071-0/+63
| | | | * fixes another effect inference bug [backport:1.6]
* Fixed `strictFuncs` support for `std/pegs` (#18951)quantimnot2021-10-071-1/+1
| | | | | | | | | | | | | | | | | * Fixed `strictFuncs` support for `std/pegs` Enabled `std/pegs` in the `strictFuncs` import test. Fixes #18057 Fixes #16892 See #18111 * Rebased from `devel` * Conditionally compile `std/pegs` in `koch` This is for supporting `csources` bootstrap. Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* correct effect tracking for .borrowed procs [backport] (#18882)Andreas Rumpf2021-09-231-1/+1
| | | | | | | | | | | * correct effect tracking for .borrowed procs [backport] * progress * fix error message in a test * correctly fix it Co-authored-by: narimiran <narimiran@disroot.org>
* fixes #12642 (#18811)Andreas Rumpf2021-09-061-0/+20
| | | | | | | | | | | | | | | | | | | * fixes #12642 * update important packages; refs #18804 * fixes #18805; refs #18806 * fixes a regression * Update testament/categories.nim Co-authored-by: flywind <xzsflywind@gmail.com> * progress * progress Co-authored-by: flywind <xzsflywind@gmail.com>
* strict effects (#18777)Andreas Rumpf2021-09-028-4/+108
| | | | | | | | | | | | | | | | | * 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
* Implement RFC-413 (#18749)Juan Carlos2021-08-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | * Implement RFC 413 * Implement RFC 413 * Implement RFC 413 * Implement RFC 413 * https://github.com/nim-lang/Nim/pull/18749#discussion_r696320995 * Update lib/js/dom_extensions.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update lib/js/dom_extensions.nim * https://github.com/nim-lang/Nim/pull/18749#discussion_r696913310 Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Extended side effect error messages (#18418)quantimnot2021-07-151-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Extended side effect error messages * Applied feedback: - refactored `markSideEffect` - refactored string interpolations - single message - skip diagnostics in `system.compiles` context Other: - started a test of diagnostic messages [ci skip] Tests aren't updated yet because messaging isn't nailed down. * - Added hints of where for side effect call locations. - Tried to clarify the reasons. * fix tests * Applied PR review feedback: - moved collection of side effects from TSym to TContext - used pragma shorthand form `.sideEffect` and `.noSideEffect` in messages - added leading '>' to structured messages for readability - changed `sempass2.markSideEffect` to a proc - replaced `system.echo` in the test to make the test compatible with Windows * Applied NEP1 formatting suggestion Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
* make strict funcs analysis smarter (#18219)Andreas Rumpf2021-06-092-0/+44
| | | | | | | * make strict funcs analysis smarter: varParam[i] = v is different from varParam[i][] = v * added a test case * Update compiler/varpartitions.nim Co-authored-by: Clyybber <darkmine956@gmail.com>
* change `--hint[X] => --hint:X` in nim repo (avoids shell quoting issues) ↵Timothee Cour2021-05-261-1/+1
| | | | (#18085)
* close #17636 (#17643)flywind2021-04-062-4/+3
|
* strictFuncs+views: add test that imports stdlib modules (#16878)ee72021-02-033-12/+198
| | | | | | | | | | | | | | | This commit attempts to improve testing of strictFuncs and views, and prevent regressions like #16873 (resolved by 0b01eddace6a). We previously only explicitly tested strictFuncs and views with a smaller number of stdlib modules, mostly in: - tests/effects/tstrict_funcs.nim - tests/views/tcan_compile_nim.nim Note that this commit leaves the `pegs` module commented out; it cannot currently be compiled with `--experimental:views` (see #16892). Note also that this commit is not sufficient to test strictFuncs and views, but it does detect a subset of problems.
* critbits: fix error from strictFuncs (#16877)ee72021-02-011-0/+1
| | | | | | | | | Previously, compiling a file containing just `import critbits` with `nim c --experimental:strictFuncs` would produce the following error: critbits.nim(529, 6) Error: 'toCritBitTree' can have side effects This was introduced by 2aed4186989e (#16564). Fixes: #16873
* fix manual to reflect reality for .nosideeffect (#16781)Timothee Cour2021-01-221-0/+24
|
* rationals.nim: Use `func` everywhere (#16302)ee72020-12-091-0/+1
|
* sequtils.nim: Use `func` (#16293)ee72020-12-091-0/+1
| | | | | | | | | * sequtils.nim: proc -> func * sequtils.nim: proc -> func in links * sequtils.nim: proc -> func in non-link doc comments * test: add `sequtils` to strictFuncs test
* complex.nim: Use `func` everywhere (#16294)ee72020-12-091-0/+1
|
* math.nim: Use `func` everywhere (#16285)ee72020-12-071-1/+9
| | | | | | | | | | | * math.nim: procs with {.noSideEffect} -> funcs * math.nim: procs without {.noSideEffect.} -> funcs * math.nim: proc -> func in links * math.nim: proc -> func in doc comments * test: add `math` to strictFuncs test
* strutils.nim: Use `func` everywhere (#16281)ee72020-12-071-2/+2
| | | | | | | | | | | | | * strutils.nim: procs with {.noSideEffect.} -> func * strutils.nim: procs without {.noSideEffect.} -> func * strutils.nim: proc -> func for links * strutils.nim: proc -> func in doc comments * test: add strutils to strictFuncs test * test: proc -> func in errmsg test
* fix #15851 (#15852)flywind2020-11-061-1/+1
| | | | | * fix #15851 * {.cast(noSideEffect).}
* fix #15756 (#15761)cooldome2020-10-281-0/+12
| | | | | * fix #15756 * simplify test
* fixes #15508 (#15509)Andreas Rumpf2020-10-071-0/+21
|
* effects: exclude swap() from "indirect calls" assumption (#15504)Paul Tan2020-10-061-0/+12
| | | | | swap() will never call any procs passed to it, and so it can be safely excluded from the "assume indirect calls are taken" effects tracking rule.
* New hint for unused exceptions in .raises (#15492)IDF2020-10-061-1/+6
| | | | | | | * New hint for unused exceptions in .raises * Fix effects test * Further adapt teffects1.nim
* implements https://github.com/nim-lang/RFCs/issues/258 (#15503)Andreas Rumpf2020-10-061-0/+18
| | | | | | | | | * implements https://github.com/nim-lang/RFCs/issues/258 * don't be too strict with custom pragma blocks * cast pragmas: documentation * added most missing inference query procs to effecttraits.nim