Skip to content

Commit

Permalink
merge tarithmetics in tarithm
Browse files Browse the repository at this point in the history
  • Loading branch information
krux02 committed Mar 2, 2020
1 parent 64a93c7 commit 1b5a28f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
18 changes: 18 additions & 0 deletions tests/arithm/tarithm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ int32
4294967295
2
0
tUnsignedOps OK
'''
nimout: "tUnsignedOps OK"
"""

import typetraits
Expand Down Expand Up @@ -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()
19 changes: 0 additions & 19 deletions tests/system/tarithmetics.nim

This file was deleted.

0 comments on commit 1b5a28f

Please sign in to comment.