Files
Nim/tests/system/tmemory.nim
metagn b97d603cd0 some test cleanups & category reorganization (#22010)
* clean up some test categories

* mention exact slice issue

* magics into system

* move trangechecks into overflow

* move tmemory to system

* try fix CI

* try fix CI

* final CI fix
2023-06-06 06:54:07 +02:00

17 lines
317 B
Nim

import std/assertions
block: # cmpMem
type
SomeHash = array[15, byte]
var
a: SomeHash
b: SomeHash
a[^1] = byte(1)
let c = a
doAssert cmpMem(a.addr, b.addr, sizeof(SomeHash)) > 0
doAssert cmpMem(b.addr, a.addr, sizeof(SomeHash)) < 0
doAssert cmpMem(a.addr, c.addr, sizeof(SomeHash)) == 0