-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: move noir program templates into separate files (#3215)
- Loading branch information
1 parent
d4f61d3
commit 3bb250e
Showing
4 changed files
with
30 additions
and
32 deletions.
There are no files selected for viewing
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
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,11 @@ | ||
fn main(x: Field, y: pub Field) { | ||
assert(x != y); | ||
} | ||
|
||
#[test] | ||
fn test_main() { | ||
main(1, 2); | ||
|
||
// Uncomment to make test fail | ||
// main(1, 1); | ||
} |
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,5 @@ | ||
contract Main { | ||
internal fn double(x: Field) -> pub Field { x * 2 } | ||
fn triple(x: Field) -> pub Field { x * 3 } | ||
fn quadruple(x: Field) -> pub Field { double(double(x)) } | ||
} |
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,11 @@ | ||
fn not_equal(x: Field, y: Field) -> bool { | ||
x != y | ||
} | ||
|
||
#[test] | ||
fn test_not_equal() { | ||
assert(not_equal(1, 2)); | ||
|
||
// Uncomment to make test fail | ||
// assert(not_equal(1, 1)); | ||
} |