add more tests
This commit is contained in:
parent
f8f3c889bd
commit
350430f66c
5 changed files with 37 additions and 2 deletions
|
@ -0,0 +1,6 @@
|
|||
def main(bool a) {
|
||||
bool mut b = false;
|
||||
asm {
|
||||
b <-- a;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
def main() {
|
||||
field[2] mut a = [0; 2];
|
||||
asm {
|
||||
a <== [1, 2];
|
||||
}
|
||||
}
|
|
@ -1834,7 +1834,7 @@ impl<'ast, T: Field> Checker<'ast, T> {
|
|||
}
|
||||
ty => Err(ErrorInner {
|
||||
span: Some(span),
|
||||
message: format!("Assignee must be a field element, found {}", ty),
|
||||
message: format!("Assignee must be of type field, found {}", ty),
|
||||
}),
|
||||
},
|
||||
false => {
|
||||
|
@ -1849,7 +1849,7 @@ impl<'ast, T: Field> Checker<'ast, T> {
|
|||
},
|
||||
false => Err(ErrorInner {
|
||||
span: Some(span),
|
||||
message: "Assignee must be a field element or a composite type of field elements".to_string(),
|
||||
message: "Assignee must be of type field or a composite type of field elements".to_string(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"curves": ["Bn128"],
|
||||
"max_constraint_count": 1,
|
||||
"tests": [
|
||||
{
|
||||
"input": {
|
||||
"values": ["2", "2", "4"]
|
||||
},
|
||||
"output": {
|
||||
"Ok": {
|
||||
"value": []
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
def main(field a, field b, field c) {
|
||||
field[2] mut out = [0; 2];
|
||||
asm {
|
||||
out <-- [a, b];
|
||||
out[0] * out[1] === c;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue