summary refs log tree commit diff stats
path: root/tests/errmsgs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errmsgs')
-rw-r--r--tests/errmsgs/t6483.nim2
-rw-r--r--tests/errmsgs/t8339.nim2
-rw-r--r--tests/errmsgs/t9908_01.nim10
-rw-r--r--tests/errmsgs/t9908_02.nim10
-rw-r--r--tests/errmsgs/tproper_stacktrace.nim2
-rw-r--r--tests/errmsgs/treportunused.nim2
6 files changed, 24 insertions, 4 deletions
diff --git a/tests/errmsgs/t6483.nim b/tests/errmsgs/t6483.nim
index 59ea6d7e2..0e977b36d 100644
--- a/tests/errmsgs/t6483.nim
+++ b/tests/errmsgs/t6483.nim
@@ -16,7 +16,7 @@ type
     variables: seq[VarItem]
     children: seq[VarScope]
 
-when isMainModule:
+when true:
   var scope1 = VarScope(
     variables: newSeq[VarItem](),
     children: newSeq[VarScope]()
diff --git a/tests/errmsgs/t8339.nim b/tests/errmsgs/t8339.nim
index f0a97658a..720e080c0 100644
--- a/tests/errmsgs/t8339.nim
+++ b/tests/errmsgs/t8339.nim
@@ -1,6 +1,6 @@
 discard """
-  line: 8
   errormsg: "type mismatch: got <seq[int]> but expected 'seq[float]'"
+  line: 8
 """
 
 import sequtils
diff --git a/tests/errmsgs/t9908_01.nim b/tests/errmsgs/t9908_01.nim
new file mode 100644
index 000000000..b9d37b67b
--- /dev/null
+++ b/tests/errmsgs/t9908_01.nim
@@ -0,0 +1,10 @@
+discard """
+errormsg: "ordinal type expected"
+line: 10
+"""
+
+# https://github.com/nim-lang/Nim/issues/9908
+
+type
+  X = enum
+    a = ("a", "b")
diff --git a/tests/errmsgs/t9908_02.nim b/tests/errmsgs/t9908_02.nim
new file mode 100644
index 000000000..7ff3d1ff7
--- /dev/null
+++ b/tests/errmsgs/t9908_02.nim
@@ -0,0 +1,10 @@
+discard """
+errormsg: "ordinal type expected"
+line: 10
+"""
+
+# https://github.com/nim-lang/Nim/pull/9909#issuecomment-445519287
+
+type
+  E = enum
+    myVal = 80.9
diff --git a/tests/errmsgs/tproper_stacktrace.nim b/tests/errmsgs/tproper_stacktrace.nim
index 134946651..c0090a595 100644
--- a/tests/errmsgs/tproper_stacktrace.nim
+++ b/tests/errmsgs/tproper_stacktrace.nim
@@ -66,7 +66,7 @@ template verifyStackTrace*(expectedStackTrace: string, body: untyped) =
 
 
 
-when isMainModule:
+when true:
 # <-- Align with line 70 in the text editor
   block:
     proc bar() =
diff --git a/tests/errmsgs/treportunused.nim b/tests/errmsgs/treportunused.nim
index 929da8843..c74fea46f 100644
--- a/tests/errmsgs/treportunused.nim
+++ b/tests/errmsgs/treportunused.nim
@@ -12,10 +12,10 @@ treportunused.nim(27, 5) Hint: 's9' is declared but not used [XDeclaredButNotUse
 treportunused.nim(21, 10) Hint: 's3' is declared but not used [XDeclaredButNotUsed]
 treportunused.nim(28, 6) Hint: 's10' is declared but not used [XDeclaredButNotUsed]
 '''
+action: compile
 """
 
 # bug #9764
-
 iterator s1(a:string): int = discard
 iterator s2(): int = discard
 template s3(): untyped = 123