summary refs log tree commit diff stats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Guard against null exception (#10162)rec2019-01-041-0/+3
|
* fix bug in doAssertRaises when exception==Exception (#10172)Timothee Cour2019-01-041-0/+12
| | | | | * fix bug in doAssertRaises when exception==Exception * add testcase for doAssertRaises
* exportc is now not allowed for type aliases (#9979)Neelesh Chandola2019-01-021-0/+12
|
* fixes #10148 (#10149)cooldome2018-12-311-0/+29
| | | | | * fixes #10148 * fix a typo
* fix off by 1 error in `col` shown by toFileLineCol (#10138)Timothee Cour2018-12-313-3/+3
| | | | | * fix off by 1 error in `col` shown by toFileLineCol * fix test failures
* Resolve things raised in https://github.com/nim-lang/Nim/issues/10081 ? (#10084)c-blake2018-12-311-9/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Resolve things raised in https://github.com/nim-lang/Nim/issues/10081 ? CDF is a standard ident in all things related to random numbers/sampling, and full words "cumulativeDistributionFunction" would be silly long, in this case, IMO. We use lowercase `cdf` to make it not look like a type, remove all looping from `sample` letting callers do it. Besides just side-stepping any `sampleSize` name choice, callers may want to filter out samples anyway which this makes slightly simpler. Also add two variants of `cumsum`, value return and in-place update distinguished by the var-ness of the first argument. Add tests for `int` and `float` for both `cumsum` and the new `sample`. (The sample tests exercise the value return mode of `cumsum`.) Functionality pre-this-PR `sample(a, w)` is now the almost as simple `for i in 0..<n: sample(a, w.cumsum)`, but this new code factoring is almost surely better. The statistical tests pass, as before. * Address Araq comment in https://github.com/nim-lang/Nim/pull/10084 We can always add in some `var` version later if desired to save memory, but this change now at least firms up the `sample` interface. * Rename `cumsum` -> `cumsummed` to honor NEP1 style. Re-instate `cumsum` as the in-place transformation. Test both in `tests/stdlib/tmath.nim` and use `cumsummed` in the example code for sample since that's a simpler example. * Fix requests from https://github.com/nim-lang/Nim/pull/10084 : example in lib/pure/math.nim and comment whitespace in lib/pure/random.nim
* Check there are no side effects before optimizing away compile time ↵deech2018-12-311-0/+42
| | | | expressions. (#9934)
* Dead code elimination for entire modules and their init procs if empty (#10032)cooldome2018-12-302-1/+7
| | | | | | * fixes #9798 * Change order of write modules * Move datInit calls ahead of initStackBottom
* Show deprecation warning for fields of a deprecated enum (#10112)Neelesh Chandola2018-12-301-4/+14
| | | | | | * Show deprecation warning for fields of a deprecated enum * Add test
* Deprecated pragma is now supported on enum fields (#10113)Neelesh Chandola2018-12-302-0/+32
| | | | | | * {.deprecated.} pragma is now supported for enum fields * Add tests * Simplify code
* fix typetraits.`$` regression https://github.com/c-blake/cligen/issues/84 ↵Timothee Cour2018-12-301-0/+3
| | | | | | | (#10131) * fix typetraits.`$` regression https://github.com/c-blake/cligen/issues/84 * add test
* Support undefined in isNil (#9960)Alexander Ivanov2018-12-301-0/+16
|
* fixes #10082Andreas Rumpf2018-12-301-0/+11
|
* revives: Move typetraits.`$` to system. Fixes #5827 (#10071)Timothee Cour2018-12-301-0/+14
| | | | | | * Move typetraits.`$` to system. Fixes #5827. * revive PR; adjust code to make sure everything works and add tests * fix tests/concepts/tstackconcept.nim * address comments
* Const tuple unpacking: add tests (#10100)ee72018-12-271-0/+16
|
* fixes #10101 (#10103)Timothee Cour2018-12-272-5/+5
|
* Add ability to sample elements from openArray according to a weight array ↵c-blake2018-12-231-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#10072) * Add the ability to sample elements from an openArray according to a parallel array of weights/unnormalized probabilities (any sort of histogram, basically). Also add a non-thread safe version for convenience. * Address Araq comments on https://github.com/nim-lang/Nim/pull/10072 * import at top of file and space after '#'. * Put in a check for non-zero total weight. * Clarify constraint on `w`. * Rename `rand(openArray[T])` to `sample(openArray[T])` to `sample`, deprecating old name and name new (openArray[T], openArray[U]) variants `sample`. * Rename caller-provided state version of rand(openArray[T]) and also clean up doc comments. * Add test for new non-uniform array sampler. 3 sd bound makes it 99% likely that it will still pass in the future if the random number generator changes. We cannot both have a tight bound to check distribution *and* loose check to ensure resilience to RNG changes. (We cannot *guarantee* resilience, anyway. There's always a small chance any test hits a legitimate random fluctuation.)
* fixes #10033 [backport]Araq2018-12-221-1/+24
|
* Don't use parseutils.parseInt in the times module (#10028)Oscar Nihlgård2018-12-221-0/+11
|
* Fixed insert for nil seq in js (#10068)Yuriy Glukhov2018-12-211-0/+32
|
* C++: make async tests green on WindowsAraq2018-12-211-0/+1
|
* os.walkDir: correctly evaluate paths when relative = true (#10057) [backport]alaviss2018-12-211-0/+8
|
* lots of testament bug fixes and improvements: (#10044)Timothee Cour2018-12-201-11/+11
|
* use anon structs and unions for a much better debug experience (#10055)Andreas Rumpf2018-12-201-23/+20
|
* Make copies for params which are captured in closures. Fixes #7048 (#10050)rec2018-12-201-0/+44
| | | | | * Copy params which are captured in closures. Fixes #7048 * Forgot to emit a newline; minor adjustments to the test
* fix test failureTimothee Cour2018-12-191-0/+1
|
* fix #8255 numerous issues with splitFileTimothee Cour2018-12-191-0/+15
|
* proc does not take untyped/typed as argument (#9981)Neelesh Chandola2018-12-192-0/+14
| | | | | | * proc does not take untyped/typed as argument * Add TODO
* [os] fix #10017 regression, fix #10025 regression (#10018)Timothee Cour2018-12-181-2/+5
| | | | | * [os] fix #10017 regression * [os] fix #10025 regression
* add `getCurrentCompilerExe` to vmops (eg allows to get nim compiler at CT); ↵Timothee Cour2018-12-182-0/+49
| | | | add tests for vmops (#9925)
* Fixes #10005recloser2018-12-151-0/+17
|
* fixes #9994Andreas Rumpf2018-12-153-1/+5
|
* fixes #9978Andreas Rumpf2018-12-142-0/+9
|
* os.nim: use the new pathnorm.normalizePath implementationAraq2018-12-141-55/+26
|
* fixes joinPath regressionsAraq2018-12-131-0/+5
|
* os.nim: big refactoring, use the new pathnorm that was extracted by ↵Araq2018-12-131-63/+94
| | | | compiler/pathutils.nim; added os.relativePath
* Merge pull request #8748 from LemonBoy/when-in-objectsAndreas Rumpf2018-12-121-0/+51
|\ | | | | Pervasive replacement of nkRecWhen in generic types
| * Pervasive replacement of nkRecWhen in generic typesLemonBoy2018-10-191-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Long story short, even if the type contains no reference at all to its generic parameters we still have to walk its AST and evaluate any nkRecWhen nodes that semRecordNodeAux skipped due to the type being a generic one. We also must be careful to modify the type `n` node in place since it may be referenced by the caller as seen in the tillegaltyperecursion test. Moreover we also can't have the nkSym drift away from their original values in order not to break the JS nkObjConstr codegen.
| * Don't skip poll() when no handles are present. (#8727)Dominik Picheta2018-08-231-0/+17
| | | | | | | | | | | | | | | | | | | | | | Fixes #7886. Fixes #7758. Fixes #6929. Fixes #3909. Replaces #8209.
* | Merge pull request #9937 from cooldome/pragmablock_custom_pragmaAndreas Rumpf2018-12-121-0/+22
|\ \ | | | | | | Language feature: implement custom pragmas in pragma blocks
| * | add testAndrii Riabushenko2018-12-111-0/+22
| | |
* | | Rework nil/option for nre in light of ""==nilFlaviu Tamas2018-12-113-18/+25
| | | | | | | | | | | | Fixes #9243
* | | Revert 7f49364fd0 for nreFlaviu Tamas2018-12-112-5/+5
| | |
* | | Merge pull request #9805 from pacien/181126-list-appendAndreas Rumpf2018-12-111-1/+2
|\ \ \ | | | | | | | | add SinglyLinkedList.append procs
| * | | add SinglyLinkedList.append procspacien2018-11-271-1/+2
| | | |
* | | | Merge pull request #9881 from timotheecour/pr_ref_9880Andreas Rumpf2018-12-112-9/+32
|\ \ \ \ | | | | | | | | | | refs #9880 show index and bound in lots of `index out of bounds` errors
| * | | | refs #9880 show index and bound in lots of `index out of bounds` errorsTimothee Cour2018-12-092-9/+32
| | | | |
* | | | | make tests green againAraq2018-12-111-0/+2
| | | | |
* | | | | attempt to make travis greenAraq2018-12-111-0/+1
| | | | |
* | | | | megatest: make it green on LinuxAraq2018-12-116-9/+9
| | | | |