-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(brillig): added tests for all field binary operations (#1586)
- Loading branch information
1 parent
06543b5
commit 3c9f106
Showing
6 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
File renamed without changes.
Empty file.
25 changes: 25 additions & 0 deletions
25
crates/nargo_cli/tests/test_data_ssa_refactor/brillig_field_binary_operations/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Tests arithmetic operations on fields | ||
fn main() { | ||
let x = 4; | ||
let y = 2; | ||
assert((x + y) == add(x, y)); | ||
assert((x - y) == sub(x, y)); | ||
assert((x * y) == mul(x, y)); | ||
assert((x / y) == div(x, y)); | ||
} | ||
|
||
unconstrained fn add(x : Field, y : Field) -> Field { | ||
x + y | ||
} | ||
|
||
unconstrained fn sub(x : Field, y : Field) -> Field { | ||
x - y | ||
} | ||
|
||
unconstrained fn mul(x : Field, y : Field) -> Field { | ||
x * y | ||
} | ||
|
||
unconstrained fn div(x : Field, y : Field) -> Field { | ||
x / y | ||
} |
1 change: 1 addition & 0 deletions
1
...s/nargo_cli/tests/test_data_ssa_refactor/brillig_field_binary_operations/target/test.json
Large diffs are not rendered by default.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
crates/nargo_cli/tests/test_data_ssa_refactor/brillig_sum/Prover.toml
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
crates/nargo_cli/tests/test_data_ssa_refactor/brillig_sum/src/main.nr
This file was deleted.
Oops, something went wrong.