tincompletecaseobject2.nim 931 B

123456789101112131415161718192021222324252627282930
  1. discard """
  2. cmd: "nim check $file"
  3. errormsg: "not all cases are covered; missing: {A, B}"
  4. nimout: '''
  5. tincompletecaseobject2.nim(18, 1) Error: not all cases are covered; missing: {' ', '!', '\"', '#', '$', '%', '&', '\'', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~'}
  6. tincompletecaseobject2.nim(22, 1) Error: not all cases are covered; missing: {B, C, D}
  7. tincompletecaseobject2.nim(25, 1) Error: not all cases are covered; missing: {A, C}
  8. tincompletecaseobject2.nim(28, 1) Error: not all cases are covered; missing: {A, B}
  9. '''
  10. """
  11. type
  12. ABCD = enum A, B, C, D
  13. AliasABCD = ABCD
  14. RangeABC = range[A .. C]
  15. AliasRangeABC = RangeABC
  16. PrintableChars = range[' ' .. '~']
  17. case PrintableChars 'x':
  18. of '0'..'9', 'A'..'Z', 'a'..'z': discard
  19. of '(', ')': discard
  20. case AliasABCD A:
  21. of A: discard
  22. case RangeABC A:
  23. of B: discard
  24. case AliasRangeABC A:
  25. of C: discard