diff options
Diffstat (limited to 'tests/overflw')
-rw-r--r-- | tests/overflw/toverflw.nim | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/overflw/toverflw.nim b/tests/overflw/toverflw.nim index fbe0d0a38..771a43303 100644 --- a/tests/overflw/toverflw.nim +++ b/tests/overflw/toverflw.nim @@ -2,20 +2,20 @@ discard """ file: "toverflw.nim" output: "the computation overflowed" """ -# Tests nim's ability to detect overflows - -{.push overflowChecks: on.} - -var - a, b: int -a = high(int) -b = -2 -try: - writeln(stdout, b - a) -except OverflowError: - writeln(stdout, "the computation overflowed") - -{.pop.} # overflow check -#OUT the computation overflowed +# Tests nim's ability to detect overflows + +{.push overflowChecks: on.} + +var + a, b: int +a = high(int) +b = -2 +try: + writeLine(stdout, b - a) +except OverflowError: + writeLine(stdout, "the computation overflowed") + +{.pop.} # overflow check +#OUT the computation overflowed |