-
Notifications
You must be signed in to change notification settings - Fork 651
Add box tests for local_into_box #8695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add box tests for local_into_box #8695
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
orizi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@orizi reviewed 1 of 2 files at r1, all commit messages.
Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @TomerStarkware)
corelib/src/test/language_features/box_test.cairo line 4 at r1 (raw file):
#[inline(never)] pub fn into_box<T>(value: T) -> Box<T> {
doc
corelib/src/test/language_features/box_test.cairo line 45 at r1 (raw file):
let boxed_b = into_box(TestEnum::B(1)); assert_eq!(boxed_b.unbox(), TestEnum::B(1)); }
Suggestion:
#[test]
fn test_local_into_box() {
assert_eq!(into_box((1, 2_u256, 3)).unbox(), (1, 2, 3));
assert_eq!(into_box(()).unbox(), ());
assert_eq!(into_box(Some(6_u8)).unbox(), Some(6));
assert_eq!(into_box(None::<u8>).unbox(), None);
assert_eq!(into_box(Ok::<u16, u256>(7)).unbox(), Ok(7));
assert_eq!(into_box(Err::<u16, u256>(8)).unbox(), Err(8));
}c17df4c to
c62d60d
Compare
f770888 to
e2ff4a7
Compare
giladchase
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 2 files reviewed, 2 unresolved discussions (waiting on @orizi and @TomerStarkware)
corelib/src/test/language_features/box_test.cairo line 4 at r1 (raw file):
Previously, orizi wrote…
doc
Done.
corelib/src/test/language_features/box_test.cairo line 45 at r1 (raw file):
let boxed_b = into_box(TestEnum::B(1)); assert_eq!(boxed_b.unbox(), TestEnum::B(1)); }
Done.
e2ff4a7 to
ddc96e1
Compare
c62d60d to
4693664
Compare
ddc96e1 to
847c438
Compare
4693664 to
3f4d687
Compare

Folded into prev level