add test
This commit is contained in:
parent
dce8a2979e
commit
9fc66516c4
4 changed files with 53 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"entry_point": "./tests/tests/arrays/identity.code",
|
||||
"entry_point": "./tests/tests/arrays/identity.zok",
|
||||
"curves": ["Bn128", "Bls12_381", "Bls12_377", "Bw6_761"],
|
||||
"tests": [
|
||||
{
|
||||
|
|
50
zokrates_core_test/tests/tests/arrays/select.json
Normal file
50
zokrates_core_test/tests/tests/arrays/select.json
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"entry_point": "./tests/tests/arrays/select.zok",
|
||||
"max_constraint_count": 44,
|
||||
"curves": ["Bn128", "Bls12_381", "Bls12_377", "Bw6_761"],
|
||||
"tests": [
|
||||
{
|
||||
"input": {
|
||||
"values": ["0", "11", "22", "0"]
|
||||
},
|
||||
"output": {
|
||||
"Ok": {
|
||||
"values": ["0"]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"values": ["0", "11", "22", "1"]
|
||||
},
|
||||
"output": {
|
||||
"Ok": {
|
||||
"values": ["11"]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"values": ["0", "11", "22", "2"]
|
||||
},
|
||||
"output": {
|
||||
"Ok": {
|
||||
"values": ["22"]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"input": {
|
||||
"values": ["0", "11", "22", "3"]
|
||||
},
|
||||
"output": {
|
||||
"Err": {
|
||||
"UnsatisfiedConstraint": {
|
||||
"left": "1",
|
||||
"right": "0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
2
zokrates_core_test/tests/tests/arrays/select.zok
Normal file
2
zokrates_core_test/tests/tests/arrays/select.zok
Normal file
|
@ -0,0 +1,2 @@
|
|||
def main(field[3] array, u32 index) -> field:
|
||||
return array[index]
|
Loading…
Reference in a new issue