summary refs log tree commit diff stats
path: root/tests/stdlib
Commit message (Collapse)AuthorAgeFilesLines
* os.execShellCmd: fixes #10231 (#10232)alaviss2019-01-081-0/+13
| | | | | | | Darwin has long deprecated the wait union, but their macros still assume it unless you define _POSIX_C_SOURCE. This trips up C++ compilers. This commit duplicates the behavior of WEXITSTATUS when _POSIX_C_SOURCE is defined.
* Fix getAddrInfo, add IPPROTO_ICMPV6 Closes #10198Federico Ceratto2019-01-061-0/+36
|
* 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
* 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.)
* Don't use parseutils.parseInt in the times module (#10028)Oscar Nihlgård2018-12-221-0/+11
|
* os.walkDir: correctly evaluate paths when relative = true (#10057) [backport]alaviss2018-12-211-0/+8
|
* fix test failureTimothee Cour2018-12-191-0/+1
|
* fix #8255 numerous issues with splitFileTimothee Cour2018-12-191-0/+15
|
* [os] fix #10017 regression, fix #10025 regression (#10018)Timothee Cour2018-12-181-2/+5
| | | | | * [os] fix #10017 regression * [os] fix #10025 regression
* 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
* 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
| |
* | testament: joinable is now an explicit concept of a test specAndreas Rumpf2018-12-111-0/+1
| |
* | lots of small changesArne Döring2018-12-111-1/+1
| |
* | megatest checks output and nimoutArne Döring2018-12-111-11/+0
| |
* | megatest can be executedArne Döring2018-12-112-2/+2
| |
* | require errormsg to be specified before file.Arne Döring2018-12-1120-43/+11
| |
* | Merge pull request #9803 from GULPF/walkdirrec-relativeAndreas Rumpf2018-12-061-0/+19
|\ \ | |/ |/| Add `relative` parameter to walkDirRec
| * Add `relative` parameter to walkDirRecOscar Nihlgård2018-11-261-0/+19
| |
* | Add workingDir parameter to execProcess and test (#9549)Tomohiro2018-11-262-0/+32
| | | | | | | | | | | | * Add workingDir parameter to execProcess * Fix tests/stdlib/tosproc.nim compile error * Suppress output from tosproc.nim
* | Added cgi.readData. Add test for cgi module. (#9645)Constantine Molchanov2018-11-261-0/+23
| | | | | | Added cgi.readData. Add test for cgi module.
* | Windows: disabled testsAraq2018-11-231-0/+1
| |
* | eyewashArne Döring2018-11-231-1/+2
| |
* | more tests fixedArne Döring2018-11-233-3/+20
| |
* | activated more tests, allow input in test specArne Döring2018-11-2314-108/+152
| |
* | updated tests to be executedArne Döring2018-11-234-3/+25
| |
* | delete old cruftArne Döring2018-11-231-11/+0
|/
* make tests green againAraq2018-11-161-1/+1
|
* removes deprecated T/P typesAraq2018-11-161-5/+5
|
* times - remove unneeded negative sign when parsing formats z and zz (#9631)pgkos2018-11-061-0/+9
| | | | | | * fix wrong utcoffset sign for formats z and zz * add tests for the timezone offset formats
* Add parsing empty attribs to htmlparser (#9559)rec2018-10-301-1/+14
|
* More descriptive names of test files (#9531)Miran2018-10-292-0/+0
| | | | | * change generic `tissues` name to more specific * change `tvarious` to more specific names
* Make htmlparser parse unquoted attrib values (#9537)rec2018-10-291-0/+45
| | | Fixes #6154
* Remove install.txt and readme.txt (#9521)Utwo2018-10-283-3/+3
| | | | | | | | * Remove install.txt and readme.txt * Refactor tests that use readme.txt * Tests open own source code
* Fix strscans.scanp (#9518)xzfc2018-10-281-0/+86
| | | | | | | | * strscans: fix typo * strscans: fix #9240 * strscans: add tests
* Parse the usage of the SQL in operator properly (#9527)zah2018-10-281-1/+1
| | | Also adds a `treeRepr` renderer for the SQL nodes.
* add test caseVindaar2018-10-201-0/+4
|
* merge stdlib tests (#9439)Miran2018-10-1928-522/+458
|
* fix #9394 by replacing `fmt` with `strutils.%` (#9417)Vindaar2018-10-181-0/+7
| | | | | | | | * fix #9394 by replacing `fmt` with normal string append Until issue #7632 is fixed, use string append. * use `strutils.%` instead of normal string add
* fix #8225 os.isHidden was buggy on posix (#8315)Timothee Cour2018-10-151-94/+113
| | | | | | * fix #8225 isHidden was broken on posix * scope rest of tos.nim under blocks to avoid variable scope bugs
* fixes #8916 by fixing typeinfo and marshal. (#9341)Vindaar2018-10-131-0/+13
| | | | | | | | | * fixes #8916 by removing `tyString`, `tySeq`, mod. marshal, typeinfo Need to check in `typeinfo` for nil of the underlying pointer. In marshal don't have to check for nil of seq anymore. * remove reference to string, sequence in `isNil` doc string
* Testament pre parallel (#9137)Jacek Sieka2018-10-121-1/+1
| | | | | | | | | | * testament: move to root dir (it's not a test) * osproc: fix process index passed to afterRunEvent for parallel runs it was passing the index of the process, not index of all commands * testament: complete file move
* 8684 add shortcut sort procs (#9174)Konstantin Molchanov2018-10-111-1/+61
| | | | | | | | * Stdlib: Algorithm: Add shortcut versions of sort, sorted, and isSorted procs. * Add tests for sort, sorted, and isSorted procs from algorithm module. * Merge sort tests into tsortcall.nim, remove tsort.nim. * Stdlib: Algorithm: Add shortcut versions of sort, sorted, and isSorted procs. * Add tests for sort, sorted, and isSorted procs from algorithm module. * Merge sort tests into tsortcall.nim, remove tsort.nim.
* Fix tests on NixOS (#9209) (#9285)xzfc2018-10-101-1/+1
| | | | | | | * Replace `/bin/sleep` with just `sleep`, i.e. use environment variable `$PATH` to locate binary. * Replace `/usr/share/zoneinfo` with `$TZDIR` when it is defined, fallback to hardcoded path otherwise. This is the same behavior that Glibc2 normally have, see man 3 tzset.
* fix #8341: add lastPathPart (#9116)Timothee Cour2018-10-091-19/+42
|
* os: use unlink() to remove file (#9220)alaviss2018-10-091-0/+9
| | | | | removeFile() behavior should now be consistant between Windows and POSIX Fixes #9200