diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/casestmt/tcaseexpr1.nim | 26 | ||||
-rw-r--r-- | tests/exception/t13115.nim | 9 | ||||
-rw-r--r-- | tests/generics/tmetafield.nim | 20 |
3 files changed, 36 insertions, 19 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 diff --git a/tests/exception/t13115.nim b/tests/exception/t13115.nim index 9d88bbeda..53e078076 100644 --- a/tests/exception/t13115.nim +++ b/tests/exception/t13115.nim @@ -2,12 +2,11 @@ discard """ exitcode: 1 targets: "c" matrix: "-d:debug; -d:release" - outputsub: '''t13115.nim(13) t13115 -Error: unhandled exception: This char is''' outputsub: ''' and works fine! [Exception]''' """ -const b_null: char = 0.char -var msg = "This char is `" & $b_null & "` and works fine!" +# bug #13115 +# xxx bug: doesn't yet work for cpp -raise newException(Exception, msg) \ No newline at end of file +var msg = "This char is `" & '\0' & "` and works fine!" +raise newException(Exception, msg) diff --git a/tests/generics/tmetafield.nim b/tests/generics/tmetafield.nim index 7a2375abe..cf30a936d 100644 --- a/tests/generics/tmetafield.nim +++ b/tests/generics/tmetafield.nim @@ -1,10 +1,23 @@ discard """ cmd: "nim check $options $file" - errormsg: "'proc' is not a concrete type" - errormsg: "'Foo' is not a concrete type." - errormsg: "invalid type: 'proc' in this context: 'TBaseMed'" + action: "reject" + nimout: ''' +tmetafield.nim(26, 5) Error: 'proc' is not a concrete type; for a callback without parameters use 'proc()' +tmetafield.nim(27, 5) Error: 'Foo' is not a concrete type +tmetafield.nim(29, 5) Error: invalid type: 'proc' in this context: 'TBaseMed' for var +''' """ +# bug #188 + + + + + + + + +# line 20 type Foo[T] = object x: T @@ -15,4 +28,3 @@ type var a: TBaseMed -# issue 188 |