From 1b5a28fb8de9e4539df8b09c4302d480cc3316de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20D=C3=B6ring?= Date: Sun, 1 Mar 2020 14:01:42 +0100 Subject: [PATCH] merge tarithmetics in tarithm --- tests/arithm/tarithm.nim | 18 ++++++++++++++++++ tests/system/tarithmetics.nim | 19 ------------------- 2 files changed, 18 insertions(+), 19 deletions(-) delete mode 100644 tests/system/tarithmetics.nim diff --git a/tests/arithm/tarithm.nim b/tests/arithm/tarithm.nim index fcb78bd7a4b2c..99306b3e84dc8 100644 --- a/tests/arithm/tarithm.nim +++ b/tests/arithm/tarithm.nim @@ -12,7 +12,9 @@ int32 4294967295 2 0 +tUnsignedOps OK ''' +nimout: "tUnsignedOps OK" """ import typetraits @@ -167,3 +169,19 @@ block tissue12177: echo(a - b) echo(a * b) echo(a div b) + +block tUnsignedOps: + proc testUnsignedOps() = + let a: int8 = -128 + let b: int8 = 127 + + doAssert b +% 1 == -128 + doAssert b -% -1 == -128 + doAssert b *% 2 == -2 + doAssert a /% 4 == 32 + doAssert a %% 7 == 2 + echo "tUnsignedOps OK" + + testUnsignedOps() + static: + testUnsignedOps() diff --git a/tests/system/tarithmetics.nim b/tests/system/tarithmetics.nim deleted file mode 100644 index 876413f21f325..0000000000000 --- a/tests/system/tarithmetics.nim +++ /dev/null @@ -1,19 +0,0 @@ -discard """ -nimout: "OK" -output: "OK" -""" - -proc testUnsignedOps() = - let a: int8 = -128 - let b: int8 = 127 - - doAssert b +% 1 == -128 - doAssert b -% -1 == -128 - doAssert b *% 2 == -2 - doAssert a /% 4 == 32 - doAssert a %% 7 == 2 - echo "OK" - -testUnsignedOps() -static: - testUnsignedOps()