Introduce testAll for running multiple tests in one go

This commit is contained in:
Mark Spanbroek 2021-11-30 11:43:07 +01:00
parent 3d868758b8
commit 6c7dc7123a
5 changed files with 18 additions and 1 deletions

View File

@ -0,0 +1 @@
--path:"../.."

View File

@ -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

View File

@ -1 +0,0 @@
--path:".."

4
tests/testAll.nim Normal file
View File

@ -0,0 +1,4 @@
import ./contractabi/testEncoding
import ./contractabi/testDecoding
{.warning[UnusedImport]:off.}