Nim/tests
Jake Leahy da3274d1b3
Implicit return working for async proc (#20933)
* Implicit return working for asyncdispatch proc

Closes #11558

* Test case

* Test that return value is actually used

* Update tests/async/t11558.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-12-09 18:10:33 +01:00
..
actiontable
alias fix #19349 incompatible type when mixing float32 and cfloat in generics (#20551) 2022-10-21 09:28:18 +02:00
align testament: error instead of silently ignore invalid targets; remove pointless alias target vs targets; document matrix; DRY (#16343) 2020-12-14 10:58:29 +01:00
ambsym better procvar ambiguity errors, clean up after #20457 (#20932) 2022-12-01 08:01:13 +01:00
arc fixes #20954; bounchecks for len(toOpenArray()) [backport] (#20956) 2022-12-05 22:27:18 +01:00
arithm fix #20829 Regression in int64 type matching since (#21019) 2022-12-06 07:44:54 +01:00
array style usages part one (openarray => openArray) (#19321) 2022-01-04 13:29:50 +01:00
assert Named arguments in commands + many grammar fixes (#20994) 2022-12-06 13:11:56 +01:00
assign defaults to ORC (#19972) 2022-09-23 13:05:05 +02:00
astoverload
astspec fix deprecated example (#18721) 2021-08-21 08:22:00 +02:00
async Implicit return working for async proc (#20933) 2022-12-09 18:10:33 +01:00
avr default threads on (#19368) 2022-07-06 13:06:41 +02:00
benchmarks fix #16752: threadvar now works with importcpp types; osx now uses native TLS (--tlsEmulation:off), which can be orders of magnitude faster (#16750) 2021-01-27 22:35:43 +01:00
bind 'lock levels' are deprecated, now a noop (#20539) 2022-10-11 09:17:09 +02:00
borrow borrowed procs can have a body now for documentation generation (#20617) 2022-10-24 10:08:39 +02:00
casestmt fix #18964 Small string case with else statement first in AST evaluat… (#20862) 2022-11-22 20:08:17 +01:00
ccgbugs replace data init function with consts for typeinfov2 (#20977) 2022-12-01 13:29:58 +01:00
ccgbugs2 [add testcase] NRVO does not occur with init procedures (#19462) 2022-01-29 14:06:54 +01:00
clearmsg
closure deprecate do: meaning do (): + misc cleanup (#20927) 2022-12-06 09:44:26 +01:00
cnstseq
collections follow up #20109; remove shallow seqs/strings for ORC (#20502) 2022-10-06 07:16:50 +02:00
compilepragma
compiler correct grammar (ref #20199) and add check for grammar.txt (#20494) 2022-10-06 16:36:32 +02:00
compilerapi big steps torwards an efficient, simple IC implementation (#16543) 2021-01-02 07:30:39 +01:00
compilerfeatures fix #16693: testament spec nimout too lax (#16698) 2021-04-04 13:47:28 -07:00
compiles deprecate unsafeAddr; extend addr (#19373) 2022-01-16 11:08:38 +01:00
concat
concepts fix bugs with dot & call operators [backport] (#20931) 2022-11-28 21:33:02 +01:00
constr fix #18990 Regression in proc symbol resolution; Error: attempting to… (#20554) 2022-10-12 20:44:45 -04:00
constraints
constructors Turn some of the errors back into warnings 2020-04-01 19:38:44 +02:00
controlflow fixes #9839; fixes noReturn pragma doesn't work for non-simple templates (#21048) 2022-12-08 10:37:02 +01:00
converter follow up #20109; remove shallow seqs/strings for ORC (#20502) 2022-10-06 07:16:50 +02:00
coroutines fix #15628 (#16387) 2021-01-21 17:31:47 +01:00
cpp closes #4678; add testcase (#20634) 2022-10-24 09:26:07 +08:00
defaultprocparam Add testcase for #12252 (#15676) 2020-10-22 12:51:03 +02:00
deprecated ref #20846; give a deprecation message for overriding = hook (#21020) 2022-12-05 07:13:51 +01:00
destructor fixes a severe bug of testament (#20832) 2022-11-17 09:38:07 +08:00
dir with space
discard fixes #13583; enforce void for nkWhileStmt (#20947) 2022-11-29 06:41:38 +01:00
distinct remove a special case in sigmatch; distinct pointer types no longer match nil type (#20251) 2022-08-23 19:27:20 +02:00
distros fix tdistros test which was failing on Nightlies 2020-04-28 15:59:32 +02:00
dll don't use {.rtl.} for generics, otherwise -d:useNimRtl gives ambiguous identifier nimrtl error (#18406) 2021-07-01 11:14:01 +02:00
effects build the documentation of official packages (#20986) 2022-12-06 22:37:16 +08:00
enum closes #12589; add testcase (#20769) 2022-11-06 11:46:51 +01:00
errmsgs Named arguments in commands + many grammar fixes (#20994) 2022-12-06 13:11:56 +01:00
exception An unnamed break in a block now gives an UnnamedBreak warning (#20901) 2022-11-24 07:31:47 +01:00
exprs fix #16693: testament spec nimout too lax (#16698) 2021-04-04 13:47:28 -07:00
fields use doAssert in tests (#16486) 2020-12-28 14:13:21 +01:00
float fixes ptr to cstring warnings[backport] (#20848) 2022-11-16 10:22:51 +01:00
fragmentation
friends
gc remove shallowCopy for ARC/ORC (#20070) 2022-07-26 16:51:01 +02:00
generics fix #16639 (#21017) 2022-12-05 22:52:49 +01:00
gensym defaults to ORC (#19972) 2022-09-23 13:05:05 +02:00
global fix #20866 [ORC] Bad codegen for global pointer to iterator (#20876) 2022-11-22 20:05:16 +01:00
ic defaults to ORC (#19972) 2022-09-23 13:05:05 +02:00
import_in_config
importalls typo: nonexistant => nonexistent (#17918) 2021-05-02 00:26:41 +02:00
init definite assignment analysis for let (#21024) 2022-12-06 10:19:12 +01:00
isolate fixes #19013 [backport:1.6] (#19111) 2021-11-09 12:43:16 +01:00
iter An unnamed break in a block now gives an UnnamedBreak warning (#20901) 2022-11-24 07:31:47 +01:00
js build the documentation of official packages (#20986) 2022-12-06 22:37:16 +08:00
lent 'lock levels' are deprecated, now a noop (#20539) 2022-10-11 09:17:09 +02:00
let Allow let to not have value when using importc (#14258) 2020-05-12 20:28:18 +02:00
lexer fixes #15688; handle strongSpace overflow issues (#20724) 2022-11-03 09:18:09 +01:00
lookups new .redefine pragma for templates, warn on redefinition without it (#20211) 2022-08-23 21:41:30 +02:00
macros store full definition AST for consts, fix noRewrite (#20115) 2022-09-28 15:05:01 +02:00
magics Add nkFastAsgn into semExpr (#20939) 2022-11-27 20:09:25 +01:00
manyloc defaults to ORC (#19972) 2022-09-23 13:05:05 +02:00
metatype defaults to ORC (#19972) 2022-09-23 13:05:05 +02:00
method fixes #20515; base method requires explicit {.gcsafe.} to be GC-safe (#20574) 2022-10-16 13:20:05 +02:00
misc deprecate do: meaning do (): + misc cleanup (#20927) 2022-12-06 09:44:26 +01:00
modules defaults to ORC (#19972) 2022-09-23 13:05:05 +02:00
namedparams
navigator IC navigator: added support for include files (#17784) 2021-04-19 22:37:09 +02:00
newconfig fix #8219; nim check/dump shouldn't run single nimscript project [backport: 1.6] (#19641) 2022-03-26 11:50:15 +01:00
nimble testament spec: remove errmsg alias of errormsg (#16188) 2020-11-29 17:32:34 -08:00
nimdoc fix #16993, #18054, #17835 runnableExamples now works with templates and nested templates (#18082) 2021-06-02 09:02:14 -07:00
niminaction build the documentation of official packages (#20986) 2022-12-06 22:37:16 +08:00
notnil add testcase for #9466 (#17538) 2021-03-28 00:57:22 -07:00
objects unpublic arrayWith and rename it to nimArrayWith (#21006) 2022-12-04 15:39:14 +08:00
objvariant fix #19266; allow reassign discriminant field (#19567) 2022-02-25 20:33:28 +01:00
openarray enable static tests for topenarray (#20620) 2022-10-23 00:36:11 +08:00
osproc fixes #18058 (#18162) 2021-06-03 17:12:45 +02:00
overflw Fix #15706 (#15846) 2020-11-07 08:00:41 +00:00
overload fixes #20645 (#20646) 2022-10-24 21:41:29 +02:00
package Refactor and doc package handling, module name mangling (#19821) 2022-05-30 18:52:19 +02:00
package_level_objects
parallel fixes #20958; fixes the return type of slice function [backport] (#20959) 2022-11-29 07:21:44 +01:00
parser fix issue #20922 by handling missing expr in exprList for tkOf (#20930) 2022-12-08 10:59:13 +01:00
pragmas 'lock levels' are deprecated, now a noop (#20539) 2022-10-11 09:17:09 +02:00
proc fix #15836 proc arg return type auto unexpectly match proc with concr… (#21044) 2022-12-09 18:01:13 +01:00
procvar
range fix #19678 Broken behavior with string ranges in case labels (#20475) 2022-10-01 18:17:07 +02:00
rational Error -> Defect for defects (#13908) 2020-04-28 19:56:01 +02:00
realtimeGC testament: remove deadcode related to realtimeGC, testC, callCCompiler (#18087) 2021-05-26 11:49:01 -07:00
sandwich fixes #11225; generic sandwich problems; [backport:1.2] (#17255) 2021-03-09 20:19:24 +01:00
sets overloadable enums no longer experimental (#20298) 2022-09-05 23:38:38 +02:00
showoff style usages part one (openarray => openArray) (#19321) 2022-01-04 13:29:50 +01:00
slice allow HSlice bounded by constants of distinct types (#19219) [backport:1.2] 2021-12-06 20:38:23 +01:00
specialops fix bugs with dot & call operators [backport] (#20931) 2022-11-28 21:33:02 +01:00
statictypes fix #20148 implicit compile time conversion int to ranged float cause… (#20698) 2022-10-29 18:04:05 +02:00
stdlib build the documentation of official packages (#20986) 2022-12-06 22:37:16 +08:00
stmt fix #15972 (#15994) 2020-11-18 00:14:14 +00:00
strictnotnil [Testament] Extend and document message testing aids (#19996) 2022-09-01 17:52:13 +02:00
stylecheck fixes #20397; fixes stylecheck regression (#20398) 2022-09-21 15:04:33 -04:00
system build the documentation of official packages (#20986) 2022-12-06 22:37:16 +08:00
template deprecate do: meaning do (): + misc cleanup (#20927) 2022-12-06 09:44:26 +01:00
testament [Testament] Extend and document message testing aids (#19996) 2022-09-01 17:52:13 +02:00
testdata Add new self-signed 4096 bit certificate to testdata (#19758) 2022-05-08 11:54:04 +02:00
threads fixes a severe bug of testament (#20832) 2022-11-17 09:38:07 +08:00
tools fix #13790; ptr char (+friends) should not implicitly convert to cstring (#20761) 2022-11-24 07:49:23 +01:00
trmacros store full definition AST for consts, fix noRewrite (#20115) 2022-09-28 15:05:01 +02:00
tuples closes #16331; add testcase (#20730) 2022-11-02 12:01:36 +08:00
typerel build the documentation of official packages (#20986) 2022-12-06 22:37:16 +08:00
types fix #15836 proc arg return type auto unexpectly match proc with concr… (#21044) 2022-12-09 18:01:13 +01:00
untestable build the documentation of official packages (#20986) 2022-12-06 22:37:16 +08:00
usingstmt remove {.this.} pragma, deprecated since 0.19 (#20201) 2022-08-23 19:44:37 +02:00
valgrind testament: support disabled:osx as alias to disabled:macosx (#17124) 2021-02-22 11:01:15 +01:00
varres Named arguments in commands + many grammar fixes (#20994) 2022-12-06 13:11:56 +01:00
varstmt
views Unpack mSlice tupleconstr for static openarrays (#20615) 2022-10-22 06:37:23 +02:00
vm fixes regression #20746; remove string copies for ORC booted compiler (#20776) 2022-11-07 14:36:43 +01:00
whenstmt fix #19426 compile error using when/elif/else and typedesc in template (#20550) 2022-10-21 09:26:46 +02:00
ast_pattern_matching.nim remove deprecated type pragma syntax, fix bugs that required it (#20199) 2022-09-03 09:52:13 +02:00
config.nims An unnamed break in a block now gives an UnnamedBreak warning (#20901) 2022-11-24 07:31:47 +01:00
dummy.txt
js.html
js.nim
m14634.nim use doAssert in tests (#16486) 2020-12-28 14:13:21 +01:00
mmaptest.nim Enable customizing PageShift to set PageSize for embedded targets (#19129) 2021-11-16 20:30:07 +01:00
readme.md Add a link for testament (#20923) 2022-11-26 21:48:37 +08:00
rectest.nim
stckovfl.nim
test_nimscript.nims build the documentation of official packages (#20986) 2022-12-06 22:37:16 +08:00

This directory contains the test cases.

Each test must have a filename of the form: t*.nim

Note: Testament is only aware of tests under a directory (eg tests/foo/) and will ignore top-level tests like tests/tbar.nim.

Specs

Each test can contain a spec in a discard """ ... """ block.

Check out the parseSpec procedure in the specs module for a full and reliable reference

action

Specifies what action this test should take.

Default: run

Options:

  • compile - compiles the module and fails the test if compilations fails.
  • run - compiles and runs the module, fails the test if compilation or execution of test code fails.
  • reject - compiles the module and fails the test if compilation succeeds.

There are certain spec keys that imply run, including output and outputsub.

Categories

Each folder under this directory represents a test category, which can be tested by running koch tests pcat <category> (or cat to avoid parallel testing, which is slower).

The folder dll contains simple DLL tests.

The folder realtimeGC contains a test for validating that the realtime GC can run properly without linking against the nimrtl.dll/so.