add tests

This commit is contained in:
Folkert 2022-07-22 16:56:11 +02:00
parent 6cabf11cbc
commit 20c63cd2c9
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -982,8 +982,8 @@ fn alignment_in_multi_tag_construction_two() {
#"
),
((32i64, true), 1),
((i64, bool), u8)
((32i64, true), 1, [0; 7]),
((i64, bool), u8, [u8; 7])
);
}
@ -999,8 +999,8 @@ fn alignment_in_multi_tag_construction_three() {
x
#"
),
((32i64, true, 2u8), 1),
((i64, bool, u8), u8)
((32i64, true, 2u8), 1, [0; 7]),
((i64, bool, u8), u8, [u8; 7])
);
}
@ -1861,3 +1861,21 @@ fn issue_3560_newtype_tag_constructor_has_nested_constructor_with_no_payload() {
RocStr
)
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn alignment_i128() {
assert_evals_to!(
indoc!(
r"#
x : [One I128 Bool, Empty]
x = One 42 (1 == 1)
x
#"
),
// note: rust aligns the tuple `(i128, bool)` to 8 we align it to 16,
// so add 8 extra padding bytes
((42, true), [0; 8], 1, [0; 15]),
((i128, bool), [u8; 8], u8, [u8; 15])
);
}