Added cmpMem export (#16484)
* added cmpMem export * updates * fix test * Tiny changelog change * Add a dot. Co-authored-by: Clyybber <darkmine956@gmail.com>
This commit is contained in:
parent
fc1a4faf56
commit
d5a3c2c2da
4 changed files with 81 additions and 49 deletions
15
tests/stdlib/tmemory.nim
Normal file
15
tests/stdlib/tmemory.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
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.unsafeAddr, sizeof(SomeHash)) == 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue