summary refs log tree commit diff stats
path: root/tests/effects
Commit message (Collapse)AuthorAgeFilesLines
* 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
* use func in uri module (#15486)flywind2020-10-051-1/+1
|
* views: yet another bugfix (#15447)Andreas Rumpf2020-10-011-1/+1
| | | | | | | * views: yet another bugfix * views: extended the spec * views: take into account potential hidden mutations via proc calls
* refactoring, fixes yet another strictFuncs regression (#15446)Andreas Rumpf2020-10-011-0/+17
|
* better support for slices as views (#15414)Andreas Rumpf2020-09-271-18/+0
| | | | | | * moved view tests to tests/views * refactoring * more refactorings * better support for system.toOpenArray for first class view types
* testament improvement: allow inline error messages inside test cases (#15294)Andreas Rumpf2020-09-101-10/+9
| | | | * testament support for inline error messages * adapt teffects1.nim test to show the potential
* borrow checking refinements (#15290)Andreas Rumpf2020-09-091-0/+18
| | | * added basic borrowing test
* strict funcs: use control flow information for a more precise analysis (#15271)Andreas Rumpf2020-09-061-3/+8
| | | | | * strict funcs: use control flow information for a more precise analysis * cursor inference uses control flow information
* strict func: much better error messages (#15068)Andreas Rumpf2020-07-251-1/+4
| | | | | * strict func: much better error messages * documented the 'strict funcs' mode
* writing to a location counts as "side effect"; implements ↵Andreas Rumpf2020-07-251-0/+31
| | | | https://github.com/nim-lang/RFCs/issues/234 (#15030)
* init checks and 'out' parameters (#14521)Andreas Rumpf2020-06-231-0/+28
| | | | | | | | | | | * I don't care about observable stores * enforce explicit initializations * cleaner code for the stdlib * stdlib: use explicit initializations * make tests green * algorithm.nim: set result explicitly * remove out parameters and bring the PR into a mergable state * updated the changelog
* do not track 'raise Defect' in the .raises: [] clause anymore (#14298)Andreas Rumpf2020-05-111-2/+2
| | | | | | | | | * do not track 'raise Defect' in the .raises: [] clause anymore * --panics:on maps 'raise Defect' to an unrecoverable fatal error * make tests green again * update the documentation too
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-2/+2
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* Add tests for #8481, #6490 and #4061 (#14083)Clyybber2020-04-231-0/+22
|
* '.push raises: []' now also affects proc types (#13776)Andreas Rumpf2020-03-291-2/+21
| | | | | | | | | * '.push raises: []' now also affects proc types * fixes the regression * less disruptive bugfix * another attempt
* better error messages for Nim's effect systemAraq2020-03-221-1/+2
|
* fixes a critical GC safety inference bug (#10615)Andreas Rumpf2019-03-051-0/+21
| | | | | | * fixes a critical GC safety inference bug * make nimsuggest compile again * make Nimble compile again
* fixes #6955Andreas Rumpf2019-02-131-1/+10
|
* Fix handling of reraise in effect tracking (#10582)LemonBoy2019-02-071-0/+12
| | | | | | This is the MVP in order not to get a completely useless error message from the compiler. Fixes #10579
* system refactorings (#10559)Andreas Rumpf2019-02-061-2/+2
| | | | | | | | * move IO subsystem into its own module; refs #10385 * make standalone test compile again * make C++ examples compile again * make more tests green * make sysAssert and gcAssert work again
* Fix exception tracking in try blocks (#10455)LemonBoy2019-01-271-0/+14
| | | | | | Exceptions raised inside a nkFinally/nkExcept block are not caught by the block itself. Fixes #3886
* require errormsg to be specified before file.Arne Döring2018-12-119-24/+7
|
* updated tests to be executedArne Döring2018-11-231-0/+5
|
* make tests green againAndreas Rumpf2018-07-053-4/+4
|
* make tests green againAndreas Rumpf2018-07-053-4/+4
|
* make tests green againAndreas Rumpf2018-05-021-1/+1
|
* make more tests greenAraq2018-02-101-1/+1
|
* make tests green againAndreas Rumpf2017-10-151-1/+1
|
* fixes #5620Araq2017-10-141-0/+12
|
* side-effect computation now done in the proper pass; fixes #4254Andreas Rumpf2016-08-251-3/+3
|
* tests: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-0410-20/+20
| | | | via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
* renamed writeln to writeLine in testspatrick dw2015-06-194-4/+4
|
* make test greenAraq2015-04-111-1/+1
|
* Clean up tests/effectsdef2015-02-041-1/+0
|
* fixes #325Araq2015-01-281-1/+1
|
* better effect inferenceAraq2014-11-021-1/+1
|