mirror of
https://github.com/status-im/nim-contract-abi.git
synced 2025-02-19 22:18:28 +00:00
Introduce testAll for running multiple tests in one go
This commit is contained in:
parent
3d868758b8
commit
6c7dc7123a
1
tests/contractabi/nim.cfg
Normal file
1
tests/contractabi/nim.cfg
Normal file
@ -0,0 +1 @@
|
||||
--path:"../.."
|
@ -106,6 +106,19 @@ suite "ABI encoding":
|
||||
AbiEncoder.encode(2 * 32'u8) & # offset of d in inner tuple
|
||||
AbiEncoder.encode(d)
|
||||
|
||||
test "encodes element after dynamic tuple":
|
||||
let a = @[1'u8, 2'u8, 3'u8]
|
||||
let b = 0xAABBCCDD'u32
|
||||
var encoder= AbiEncoder.init()
|
||||
encoder.startTuple()
|
||||
encoder.write(a)
|
||||
encoder.finishTuple()
|
||||
encoder.write(b)
|
||||
check encoder.finish() ==
|
||||
AbiEncoder.encode(1 * 32'u8) & # offset of a in tuple
|
||||
AbiEncoder.encode(a) &
|
||||
AbiEncoder.encode(b)
|
||||
|
||||
test "encodes arrays":
|
||||
let element1 = seq[byte].example
|
||||
let element2 = seq[byte].example
|
@ -1 +0,0 @@
|
||||
--path:".."
|
4
tests/testAll.nim
Normal file
4
tests/testAll.nim
Normal file
@ -0,0 +1,4 @@
|
||||
import ./contractabi/testEncoding
|
||||
import ./contractabi/testDecoding
|
||||
|
||||
{.warning[UnusedImport]:off.}
|
Loading…
x
Reference in New Issue
Block a user