mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-16 08:04:20 +00:00
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:
7
testament/tests/shouldfail/treject.nim
Normal file
7
testament/tests/shouldfail/treject.nim
Normal 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
|
||||
6
tests/testament/treject.nim
Normal file
6
tests/testament/treject.nim
Normal 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"
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user