mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
more boxing tests
This commit is contained in:
parent
b410ae5642
commit
052ee0cc5f
1 changed files with 54 additions and 2 deletions
|
@ -3334,7 +3334,7 @@ fn box_num() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||||
fn box_record() {
|
fn box_record_2_u64() {
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
"Box.box { x: 1u64, y: 2u64 }",
|
"Box.box { x: 1u64, y: 2u64 }",
|
||||||
RocBox::new((1u64, 2u64)),
|
RocBox::new((1u64, 2u64)),
|
||||||
|
@ -3342,6 +3342,16 @@ fn box_record() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||||
|
fn box_record_3_u64() {
|
||||||
|
assert_evals_to!(
|
||||||
|
"Box.box { x: 1u64, y: 2u64, z: 3u64 }",
|
||||||
|
RocBox::new((1u64, 2u64, 3u64)),
|
||||||
|
RocBox<(u64, u64, u64)>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||||
fn box_str() {
|
fn box_str() {
|
||||||
|
@ -3396,7 +3406,35 @@ fn box_and_unbox_f32() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||||
fn box_and_unbox_record() {
|
fn box_and_unbox_record_2_u64() {
|
||||||
|
assert_evals_to!(
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
Box.unbox (Box.box { a: 15u64, b: 27u64 })
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
(15, 27),
|
||||||
|
(u64, u64)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||||
|
fn box_and_unbox_record_3_u64() {
|
||||||
|
assert_evals_to!(
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
Box.unbox (Box.box { a: 15u64, b: 27u64, c: 34u64 })
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
(15, 27, 34),
|
||||||
|
(u64, u64, u64)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||||
|
fn box_and_unbox_record_2_u8() {
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
indoc!(
|
indoc!(
|
||||||
r#"
|
r#"
|
||||||
|
@ -3408,6 +3446,20 @@ fn box_and_unbox_record() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||||
|
fn box_and_unbox_record_3_u8() {
|
||||||
|
assert_evals_to!(
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
Box.unbox (Box.box { a: 15u8, b: 27u8, c: 34u8 })
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
(15, 27, 34),
|
||||||
|
(u8, u8, u8)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
|
||||||
fn box_and_unbox_tag_union() {
|
fn box_and_unbox_tag_union() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue