summary refs log tree commit diff stats
path: root/tests/casestmt
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-11-29 10:42:50 -0800
committerGitHub <noreply@github.com>2020-11-29 10:42:50 -0800
commit6114df3c24e9c23bfbdbaa204bb100de9d170995 (patch)
treeaaabc7a0e5ecc6ea6ba5572fef469e54f94fb876 /tests/casestmt
parentd29eddf92a1b8147c4709fd828f77152c1f3aab2 (diff)
downloadNim-6114df3c24e9c23bfbdbaa204bb100de9d170995.tar.gz
testament: error instead of silently overwrite a spec (#16166)
Diffstat (limited to 'tests/casestmt')
-rw-r--r--tests/casestmt/tcaseexpr1.nim26
1 files changed, 16 insertions, 10 deletions
diff --git a/tests/casestmt/tcaseexpr1.nim b/tests/casestmt/tcaseexpr1.nim
index 3d4b6c087..82af2410b 100644
--- a/tests/casestmt/tcaseexpr1.nim
+++ b/tests/casestmt/tcaseexpr1.nim
@@ -1,17 +1,23 @@
 discard """
-  errormsg: "type mismatch: got <string> but expected 'int'"
-  line: 33
-  file: "tcaseexpr1.nim"
-
-  errormsg: "not all cases are covered; missing: {C}"
-  line: 27
-  file: "tcaseexpr1.nim"
+  cmd: "nim check $options $file"
+  action: "reject"
+  nimout: '''
+tcaseexpr1.nim(33, 10) Error: not all cases are covered; missing: {C}
+'''
 """
 
-# NOTE: This spec is wrong. Spec doesn't support multiple error
-# messages. The first one is simply overridden by the second one.
-# This just has never been noticed.
+#[
+# xxx make nimout comparison use nimoutCheck instead of:
+elif expected.nimout.len > 0 and expected.nimout.normalizeMsg notin given.nimout.normalizeMsg:
+
+and then use nimout: '''
+tcaseexpr1.nim(33, 10) Error: not all cases are covered2; missing: {C}
+tcaseexpr1.nim(39, 12) Error: type mismatch: got <string> but expected 'int literal(10)'
+'''
+]#
+
 
+# line 20
 type
   E = enum A, B, C