Commit graph

115 commits

Author SHA1 Message Date
ringabout
c4035d7f7c
fixes unittest warnings (#21271) 2023-01-18 09:03:03 +01:00
ringabout
8266750497
[unittest] remove unnecessay export for testing (#20868) 2022-12-01 14:31:48 -05:00
ringabout
3d2f0e2c7c
make more standard libraries work with nimPreviewSlimSystem (#20343)
* make more standard libraries work with `nimPreviewSlimSystem`

* typo

* part two

* Delete specutils.nim

* fixes more tests

* more fixes

* fixes tests

* fixes three more tests

* add formatfloat import

* fix

* last
2022-09-27 20:06:23 +02:00
Dan Rose
c579243e0c
Pass check condition directly to if (#20217)
When checking conditions, pass `check` untyped argument directly to if. This results in better error messages when the condition is malformed.

Previously `check 1` would fail at compile time with `Error: type mismatch: got 'int literal(-2)' for '-2' but expected 'bool'`
Now it fails with `Error: type mismatch: got 'int literal(1)' for '1' but expected 'bool'`.

Similarly `check "foo"` would fail with
```
Error: type mismatch: got <string>
but expected one of:
proc `not`(a: typedesc): typedesc
  first type mismatch at position: 1
  required type for a: typedesc
  but expression '"somestring"' is of type: string
...
```
Now it fails with `Error: type mismatch: got 'string' for '"somestring"' but expected 'bool'`
2022-08-15 18:37:10 -04:00
flywind
68e522ecec
Remove confusing <//> (#17830) 2021-04-26 09:04:52 +02:00
Andreas Rumpf
a9b62de895
CIs: attempt to use csources_v1 (#16282)
* CIs: attempt to use csources_v1
* also updated the BSDs
* also updated azure pipelines
* std modules should not itself use the 'std/' import dir...
* compiler has to be careful with std/ for v1 booting
2021-04-21 07:41:33 +02:00
flywind
99633d7682
remove deprecated stuff in unittest module (#17156)
* remove unnecessary when statement

* remove outdated codes

* remove deprecated stuff in testament

* fix
2021-02-24 21:02:33 +01:00
flywind
8d63f7b483
clean up old codes (#17071) 2021-02-17 19:26:08 +01:00
Timothee Cour
fff5819ee7
fix #16978 unittest js foreign exception (#16998)
* fix #16978 unittest js foreign exception
2021-02-13 09:51:46 +01:00
Juan Carlos
505d04389a
Documentation only Testament unittest (#16532)
* Link Testament from unittest doc

* Update lib/pure/unittest.nim

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2021-01-01 19:44:06 +01:00
flywind
1d615dfda7
fix #16474 unittest.check type1 is type2 gives CT error (#16476)
* fix #16474
* more tests
2020-12-27 09:16:53 +01:00
Timothee Cour
82bb4db4b7
unittest: use defines instead of env vars (#16165)
* unittest: use defines instead of env vars

* use defines in testament

* fixup

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2020-12-10 00:57:52 +01:00
Clyybber
d1bea1f71f
Tiny unittest doc fix 2020-11-05 21:02:14 +01:00
flywind
adde5ba6b0
document #15618 (#15810)
* document #15618

* Update lib/pure/unittest.nim

* Update lib/pure/unittest.nim

Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>

* Update lib/pure/unittest.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: Juan Carlos <juancarlospaco@gmail.com>
2020-11-05 14:04:24 +01:00
flywind
8115b655e7
support par expression as checkpoint (#15802) 2020-10-31 09:05:01 +00:00
Serban Constantin
dd86228548
update unittest docs with correct exit code info (#15502) 2020-10-06 18:05:57 +02:00
Juan Carlos
9465b5db44
Clean up macros (#14959) 2020-07-14 16:44:56 +02:00
Timothee Cour
e07d661d16
fix #14475; unittest.require now works with nim c; require and check now works with -d:nodejs (#14676)
* fix #14475; make unittest work with -d:nodejs

* fixup

* fixup

* disable inim, delaunay which failed after unittest.require got fixed

* re-enable tests that have been fixed
2020-07-14 13:14:32 +02:00
Miran
e7f280bd26
Remove deprecated stuff from stdlib (#14699)
* update to the latest Jester

* remove deprecated procs from some stdlib modules

* 'criterion' is not maintained anymore and relies on obsolete stuff
2020-06-17 15:25:02 +02:00
hlaaftana
fbc97e712a
move since from inclrtl to std/private/since (#14188)
* move since from inclrtl to std/private/since
* move since import in system below for HCR
2020-05-02 23:51:59 +02:00
hlaaftana
0aefebb728
JS unittest stacktrace fix, cleanup js repr and inclrtl includes (#14168) 2020-04-30 17:04:53 +01:00
Jacek Sieka
7d6cbf290a
Error -> Defect for defects (#13908)
* 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.
2020-04-28 19:56:01 +02:00
hlaaftana
cd9af6b804
StringStream & more stdlib modules support for JS/NimScript (#14095)
* StringStream & more stdlib modules support for JS/NimScript

* change back pegs test in line with #14134
2020-04-28 19:44:52 +02:00
Miran
f3117d350e
fix #6736: templates in unittest now show actual value (#13354) 2020-02-07 22:04:08 +01:00
cooldome
84e8477b90
unittest add resetOutputFormatters proc (#13267)
* add resetOutputFormatters

* remove space

* resolve comments
2020-01-28 14:16:03 +00:00
ducdetronquito
df4c339cfc Namespace unittest enums to avoid name conflicts (#12468) [backport]
* [backport] Fixes: #12465 - Unittest - Namespace the usage of TestStatus enum to avoid name conflicts.
2019-10-20 08:12:02 +02:00
narimiran
5732bb41ef [backport] run nimpretty on the remaining files 2019-09-30 13:58:17 +02:00
Federico Ceratto
39290cf88c Fix spellings (#12277) [backport] 2019-09-27 07:02:54 +02:00
Araq
5abe880469 last stdlib cleanups 2019-09-21 06:43:37 +02:00
Chris Heller
35f1519ad6 Add delOutputFormatter proc to unittest.nim (#12032) 2019-09-03 08:14:19 +01:00
Dmitry Matveyev
756fabb979 Fix typo (#11910) 2019-08-08 13:17:53 +02:00
Kaushal Modi
404b224945 [bugfix] Make std/unittest compile with --styleCheck:error (#11762) 2019-07-17 19:47:50 +02:00
Araq
64518380a5 undeprecate system.programResult until we have a good solution at hand 2019-06-03 09:35:04 +02:00
Andreas Rumpf
e1515b53d1
introduce temporary <//> for 'owned' to get this compile with 0.19 (#11145)
* introduce temporary <//> for 'owned' to get this compile with 0.19
* make newTable[string, owned Node]() compile (but it crashes)
* make sink/owned parameters consistent
* make actiontable test compile again
* VM: support sytem.move; makes tests green
2019-05-02 08:07:09 +02:00
Zed
3b4952da94 Fix header inconsistencies in documentation (#11071) 2019-04-23 08:40:20 +02:00
Timothee Cour
540d102d87 fix #10261 unittest now returns 1 on error instead of buggy behavior (#10264) 2019-01-11 07:59:20 +01:00
Neelesh Chandola
a3c4791e9c Give error when case has an else branch even though all cases are already covered (#9930)
* Give error when case has an else branch even though all cases are already covered.
* Don't check for invalid else for type tyFloat..tyFloat128, tyString, tyError
* Remove unnecessary else in unittest.nim
* Fix sockets.nim
2018-12-13 09:08:10 +01:00
Araq
3f6168b337 removes deprecated T/P types 2018-11-16 13:27:56 +01:00
Andreas Rumpf
7f49364fd0 make more tests green 2018-08-13 12:29:03 +02:00
Andreas Rumpf
dae5450947 WIP: disallow 'nil' for strings and seqs 2018-08-13 11:41:33 +02:00
Timothee Cour
8ad59e6857 remove redundant test for nil before add (#8460) 2018-08-06 11:50:42 +02:00
七秒不觉梦
b6b6382e0b Added: type name output when exception raised from unittest (#7869) 2018-05-28 05:24:04 +03:00
Xiao-Yong
f543388959 unittest: default no color if stdout is not a tty (#7424)
We accept a new environment variable, NIMTEST_COLOR,
which override the effect of NIMTEST_NO_COLOR.
The environment variable, NIMTEST_COLOR, can be 'never'
or 'always', which set the color output to false or true,
respectively.
2018-04-12 17:57:34 +02:00
Alexander Ivanov
53088c05cb Disable param filtering 2018-03-27 19:23:08 +03:00
Federico Ceratto
25831a83d7 Add unittest suite/test name filters
Support simple globbing
2017-11-28 13:12:23 +00:00
Emery Hemingway
2ca7b703fb No implicit quit for Genode (#6515) 2017-10-25 13:50:55 +02:00
GULPF
5cf789ac3f Improved unittest check macro, fixes #5784 (#6446) 2017-09-30 15:39:00 +02:00
Dominik Picheta
838be26f53 Implement ability to run a single test using unittest module. 2017-08-12 14:41:33 +01:00
Ruslan Mustakov
310b73b556 Reduce the scope of stackTrace var (#5583)
Fixes #5571.
2017-03-22 01:06:05 +01:00
Araq
d365f1a81a resolved unittest conflict 2017-03-18 20:59:10 +01:00