add test
This commit is contained in:
parent
718a2d2e7f
commit
c3b00ee75c
2 changed files with 26 additions and 0 deletions
15
zokrates_core_test/tests/tests/complex_call.json
Normal file
15
zokrates_core_test/tests/tests/complex_call.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"entry_point": "./tests/tests/complex_call.zok",
|
||||
"tests": [
|
||||
{
|
||||
"input": {
|
||||
"values": ["1", "2", "0", "1", "2", "3", "4"]
|
||||
},
|
||||
"output": {
|
||||
"Ok": {
|
||||
"values": ["1", "1", "3", "4"]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
11
zokrates_core_test/tests/tests/complex_call.zok
Normal file
11
zokrates_core_test/tests/tests/complex_call.zok
Normal file
|
@ -0,0 +1,11 @@
|
|||
struct Foo {
|
||||
bool[2] a
|
||||
field b
|
||||
}
|
||||
|
||||
def f(bool a, field b, Foo c, field[2] d) -> (Foo, field):
|
||||
return Foo { a: [a, a], b: d[0] }, if c.a[0] then b + c.b else d[1] fi
|
||||
|
||||
def main(bool a, field b, Foo c, field[2] d) -> (Foo, field):
|
||||
e, f = f(a, b, c, d)
|
||||
return e, f
|
Loading…
Reference in a new issue