summary refs log tree commit diff stats
path: root/tests/casestmt
diff options
context:
space:
mode:
authorJasper Jenkins <jasper.vs.jenkins@gmail.com>2019-12-22 01:10:46 -0800
committerAndreas Rumpf <rumpf_a@web.de>2019-12-22 10:10:46 +0100
commit2e7c9eb6a8dea7e4ca6b268020058b46f6b16580 (patch)
treec7af7fa8fa893822f66819b9ee3a6cabb0719add /tests/casestmt
parent28466ce6fca801f0e0c5dd6145506a3fc6d53fa7 (diff)
downloadNim-2e7c9eb6a8dea7e4ca6b268020058b46f6b16580.tar.gz
case coverage error message for `char` (#12948)
Diffstat (limited to 'tests/casestmt')
-rw-r--r--tests/casestmt/tincompletecaseobject2.nim12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/casestmt/tincompletecaseobject2.nim b/tests/casestmt/tincompletecaseobject2.nim
index ccf6a3a6c..c080cfeb1 100644
--- a/tests/casestmt/tincompletecaseobject2.nim
+++ b/tests/casestmt/tincompletecaseobject2.nim
@@ -2,9 +2,10 @@ discard """
 cmd: "nim check $file"
 errormsg: "not all cases are covered; missing: {A, B}"
 nimout: '''
-tincompletecaseobject2.nim(16, 1) Error: not all cases are covered; missing: {B, C, D}
-tincompletecaseobject2.nim(19, 1) Error: not all cases are covered; missing: {A, C}
-tincompletecaseobject2.nim(22, 1) Error: not all cases are covered; missing: {A, B}
+tincompletecaseobject2.nim(18, 1) Error: not all cases are covered; missing: {' ', '!', '\"', '#', '$', '%', '&', '\'', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~'}
+tincompletecaseobject2.nim(22, 1) Error: not all cases are covered; missing: {B, C, D}
+tincompletecaseobject2.nim(25, 1) Error: not all cases are covered; missing: {A, C}
+tincompletecaseobject2.nim(28, 1) Error: not all cases are covered; missing: {A, B}
 '''
 """
 type
@@ -12,6 +13,11 @@ type
   AliasABCD = ABCD
   RangeABC = range[A .. C]
   AliasRangeABC = RangeABC
+  PrintableChars = range[' ' .. '~']
+
+case PrintableChars 'x':
+of '0'..'9', 'A'..'Z', 'a'..'z': discard
+of '(', ')': discard
 
 case AliasABCD A:
 of A: discard