1
0
Fork 0
mirror of synced 2025-09-23 04:08:33 +00:00

add more tests

This commit is contained in:
dark64 2023-05-30 18:27:36 +02:00
parent f8f3c889bd
commit 350430f66c
5 changed files with 37 additions and 2 deletions

View file

@ -0,0 +1,6 @@
def main(bool a) {
bool mut b = false;
asm {
b <-- a;
}
}

View file

@ -0,0 +1,6 @@
def main() {
field[2] mut a = [0; 2];
asm {
a <== [1, 2];
}
}

View file

@ -1834,7 +1834,7 @@ impl<'ast, T: Field> Checker<'ast, T> {
} }
ty => Err(ErrorInner { ty => Err(ErrorInner {
span: Some(span), span: Some(span),
message: format!("Assignee must be a field element, found {}", ty), message: format!("Assignee must be of type field, found {}", ty),
}), }),
}, },
false => { false => {
@ -1849,7 +1849,7 @@ impl<'ast, T: Field> Checker<'ast, T> {
}, },
false => Err(ErrorInner { false => Err(ErrorInner {
span: Some(span), 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(),
}) })
} }
} }

View file

@ -0,0 +1,16 @@
{
"curves": ["Bn128"],
"max_constraint_count": 1,
"tests": [
{
"input": {
"values": ["2", "2", "4"]
},
"output": {
"Ok": {
"value": []
}
}
}
]
}

View file

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