add tests for Testament "reject" action (#15709)

* add test for reject action

* highlight that a compilation failure is expected

* add the converse test for action=reject

* add trailing newline

* fix wording

(cherry picked from commit 066f3ebc2a)
This commit is contained in:
n5m
2020-10-27 07:48:14 +00:00
committed by narimiran
parent 1fbfd77580
commit 33375aff15
3 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
discard """
action: "reject"
"""
# Because we set action="reject", we expect this line not to compile. But the
# line does compile, therefore the test fails.
assert true

View File

@@ -0,0 +1,6 @@
discard """
action: "reject"
"""
# this line does not compile, so the test should pass, since action="reject"
let x: int = "type mismatch"

View File

@@ -25,6 +25,8 @@ FAIL: tests/shouldfail/toutput.nim C
Failure: reOutputsDiffer
FAIL: tests/shouldfail/toutputsub.nim C
Failure: reOutputsDiffer
FAIL: tests/shouldfail/treject.nim C
Failure: reFilesDiffer
FAIL: tests/shouldfail/tsortoutput.nim C
Failure: reOutputsDiffer
FAIL: tests/shouldfail/ttimeout.nim C