Skip to content

Commit

Permalink
Add tests and regen expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
d0cd committed Jun 24, 2023
1 parent 8062693 commit 5699352
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 19 deletions.
12 changes: 6 additions & 6 deletions tests/expectations/compiler/group/to_x_coordinate.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
namespace: Compile
expectation: Pass
outputs:
- - initial_ast: 466c3da8bb0bc3711a3071784e06a475abbd95c4afa46ce2149bdaf8fbabe6e4
unrolled_ast: 466c3da8bb0bc3711a3071784e06a475abbd95c4afa46ce2149bdaf8fbabe6e4
ssa_ast: 9455d0f91c594cacc93cba0358e1d40017f65765b59b18a341ea2966b4ecb1df
flattened_ast: b0caf68c1a6fe8ee511a80829ab30c35630daa28f86b4be4bf25adf1a0a367a8
inlined_ast: b0caf68c1a6fe8ee511a80829ab30c35630daa28f86b4be4bf25adf1a0a367a8
dce_ast: b0caf68c1a6fe8ee511a80829ab30c35630daa28f86b4be4bf25adf1a0a367a8
- - initial_ast: 20332c6a83a3628dd4f17d8653acdf28dd8e54bcaf9cab071fda7cbbf3ff3d29
unrolled_ast: 20332c6a83a3628dd4f17d8653acdf28dd8e54bcaf9cab071fda7cbbf3ff3d29
ssa_ast: 2bfa5ff05133abdf9553186a96a35c8466b5a49366ea07cea92e01f30c04f769
flattened_ast: f7fd524a8a3e98f0e01f4c71b09bea3032867a086447ea72f4cdded1a581983d
inlined_ast: f7fd524a8a3e98f0e01f4c71b09bea3032867a086447ea72f4cdded1a581983d
dce_ast: 644ec7d38093f28ca0b0908282d7ff8032f7b22a0cf98c47d5ffa0ad16f047b8
bytecode: 51e95e10668242bec30e9917715d9856da632e933c33207ee41c5ed38d6366aa
warnings: ""
12 changes: 6 additions & 6 deletions tests/expectations/compiler/group/to_y_coordinate.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
namespace: Compile
expectation: Pass
outputs:
- - initial_ast: 6cc132d16506cefce980b7ecb6637bc89a6db79e90073c307dbb75a2a25e3251
unrolled_ast: 6cc132d16506cefce980b7ecb6637bc89a6db79e90073c307dbb75a2a25e3251
ssa_ast: 8b8a2daa8b7e32c23f2d3290ab3557b7b6d98afeb2ae55c35795de7e8180ef79
flattened_ast: 00b4b6055c4035a3c016a88afa60f8504dec8542ad6413bd8340f75ce60564b2
inlined_ast: 00b4b6055c4035a3c016a88afa60f8504dec8542ad6413bd8340f75ce60564b2
dce_ast: 00b4b6055c4035a3c016a88afa60f8504dec8542ad6413bd8340f75ce60564b2
- - initial_ast: 62e89c72fcd4f62002450d1c82060f2f662ad6e1c12a19f0e6b994c50ba0491b
unrolled_ast: 62e89c72fcd4f62002450d1c82060f2f662ad6e1c12a19f0e6b994c50ba0491b
ssa_ast: b3c38a64899eef777c4bdd38d5db3f68148334795f4e9b89449eb9148db03eb3
flattened_ast: da24a573e4ff569e242f88f73869c2251e19bb5ae62ef602773c0a48863bb9b3
inlined_ast: da24a573e4ff569e242f88f73869c2251e19bb5ae62ef602773c0a48863bb9b3
dce_ast: d313e678afef867d5cbca6829c81515387bcc768eeb4044b25c7996f4d177c63
bytecode: ea2e94f0f589fac4565040575643b1b7cd7813fe513d5b09b17c191bbf0f727e
warnings: ""
14 changes: 7 additions & 7 deletions tests/expectations/execution/group_operations.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
namespace: Execute
expectation: Pass
outputs:
- - initial_ast: 0f695b51ab88009feefe657770a42c5e87c5406b480c48636bf96170be3cd606
unrolled_ast: 0f695b51ab88009feefe657770a42c5e87c5406b480c48636bf96170be3cd606
ssa_ast: 5d78ad9fd293c3227d2a7ddadff8c7c0689794fe983ab4c8370683b2ba05643e
flattened_ast: b50634e2bc12b8e27f6f6fc00cc8ab56407fdb5aec190992106cbf45143f7c96
inlined_ast: b50634e2bc12b8e27f6f6fc00cc8ab56407fdb5aec190992106cbf45143f7c96
dce_ast: b50634e2bc12b8e27f6f6fc00cc8ab56407fdb5aec190992106cbf45143f7c96
bytecode: e556ad690ff212037476e85570be2afb974da528efb4688626d824a886f9013e
- - initial_ast: ccfa20fa35d720984742081098965806736ba374ad046b3aadf6d899663375da
unrolled_ast: ccfa20fa35d720984742081098965806736ba374ad046b3aadf6d899663375da
ssa_ast: ab06973a60d8da80b174deae3dc4ee88216894503e613d3ba3ecd74c7f38e408
flattened_ast: 9a9c3bc868b2e83c0cb0822e5bbf1d6f782f7992e0b748c6390a57768c44a4a7
inlined_ast: 9a9c3bc868b2e83c0cb0822e5bbf1d6f782f7992e0b748c6390a57768c44a4a7
dce_ast: 9a9c3bc868b2e83c0cb0822e5bbf1d6f782f7992e0b748c6390a57768c44a4a7
bytecode: 5c20fda21a40464a1462524cf913438776a39383a671949312f48ce8ceb2dd16
warnings: ""
results:
main:
Expand Down
18 changes: 18 additions & 0 deletions tests/expectations/parser/expression/access/method_function.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
namespace: ParseExpression
expectation: Pass
outputs:
- Unary:
receiver:
Identifier: "{\"name\":\"a\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: ToXCoordinate
span:
lo: 0
hi: 19
- Unary:
receiver:
Identifier: "{\"name\":\"b\",\"span\":\"{\\\"lo\\\":0,\\\"hi\\\":1}\"}"
op: ToYCoordinate
span:
lo: 0
hi: 19
2 changes: 2 additions & 0 deletions tests/tests/compiler/group/to_x_coordinate.leo
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ expectation: Pass

program test.aleo {
transition main(a: group) -> field {
let x: field = a.to_x_coordinate();
let y: field = 0group.to_y_coordinate();
return group::to_x_coordinate(a);
}
}
2 changes: 2 additions & 0 deletions tests/tests/compiler/group/to_y_coordinate.leo
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ expectation: Pass

program test.aleo {
transition main(a: group) -> field {
let x: field = a.to_x_coordinate();
let y: field = 0group.to_y_coordinate();
return group::to_y_coordinate(a);
}
}
4 changes: 4 additions & 0 deletions tests/tests/execution/group_operations.leo
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ program test.aleo {
transition main(a: group) -> (field, field) {
let b: field = group::to_x_coordinate(a);
let c: field = a as field;
let e: field = a.to_x_coordinate();
assert_eq(b, c);
assert_eq(b, e);
let d: field = group::to_y_coordinate(a);
let f: field = a.to_y_coordinate();
assert_eq(d, f);
return (b, d);
}
}
7 changes: 7 additions & 0 deletions tests/tests/parser/expression/access/method_function.leo
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
namespace: ParseExpression
expectation: Pass
*/

a.to_x_coordinate()
b.to_y_coordinate()

0 comments on commit 5699352

Please sign in to comment.