codegen doesn't produce line tracing commands anymore; fixes #1344
This commit is contained in:
parent
508e8bd686
commit
5641be51c1
9 changed files with 277 additions and 216 deletions
43
tests/misc/trangechecks.nim
Normal file
43
tests/misc/trangechecks.nim
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
discard """
|
||||
output: '''10
|
||||
10
|
||||
1
|
||||
1
|
||||
true'''
|
||||
"""
|
||||
|
||||
# bug #1344
|
||||
|
||||
var expected: int
|
||||
var x: range[1..10] = 10
|
||||
|
||||
try:
|
||||
x += 1
|
||||
echo x
|
||||
except OverflowError, RangeError:
|
||||
expected += 1
|
||||
echo x
|
||||
|
||||
try:
|
||||
inc x
|
||||
echo x
|
||||
except OverflowError, RangeError:
|
||||
expected += 1
|
||||
echo x
|
||||
|
||||
x = 1
|
||||
try:
|
||||
x -= 1
|
||||
echo x
|
||||
except OverflowError, RangeError:
|
||||
expected += 1
|
||||
echo x
|
||||
|
||||
try:
|
||||
dec x
|
||||
echo x
|
||||
except OverflowError, RangeError:
|
||||
expected += 1
|
||||
echo x
|
||||
|
||||
echo expected == 4
|
||||
Loading…
Add table
Add a link
Reference in a new issue