1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

more complete test

This commit is contained in:
schaeff 2021-05-05 16:26:27 +02:00
parent f6f4ccea46
commit 7c52016a6d
3 changed files with 21 additions and 13 deletions

View file

@ -1,14 +1,14 @@
{
"entry_point": "./tests/tests/structs/mutate_argument.zok",
"entry_point": "./tests/tests/pass_by_value.zok",
"curves": ["Bn128", "Bls12_381", "Bls12_377", "Bw6_761"],
"tests": [
{
"input": {
"values": ["1"]
"values": ["1", "1", "1"]
},
"output": {
"Ok": {
"values": ["2", "1"]
"values": ["2", "1", "2", "1", "2", "1"]
}
}
}

View file

@ -0,0 +1,18 @@
struct Foo {
field a
}
def mutate(field a) -> field:
a = a + 1
return a
def mutate(Foo f) -> Foo:
f.a = f.a + 1
return f
def mutate(field[1] f) -> field[1]:
f[0] = f[0] + 1
return f
def main(field[1] f, Foo g, field h) -> (field[1], field[1], Foo, Foo, field, field):
return mutate(f), f, mutate(g), g, mutate(h), h

View file

@ -1,10 +0,0 @@
struct Foo {
field a
}
def mutate(field[1] f) -> field[1]:
f[0] = f[0] + 1
return f
def main(field[1] f) -> (field[1], field[1]):
return mutate(f), f