dev: box and unbox 16-bit and 8-bit values

This commit is contained in:
Folkert 2023-02-11 15:31:35 +01:00
parent 49d52f5d9a
commit ee79a311f9
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
4 changed files with 299 additions and 12 deletions

View file

@ -3317,6 +3317,24 @@ fn box_and_unbox_32bit_num() {
assert_evals_to!("Box.unbox (Box.box (123u32))", 123, u32)
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn box_and_unbox_16bit_num() {
assert_evals_to!("Box.unbox (Box.box (123u16))", 123, u16)
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn box_and_unbox_8bit_num() {
assert_evals_to!("Box.unbox (Box.box (123u8))", 123, u8)
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn box_and_unbox_1bit_num() {
assert_evals_to!("Box.unbox (Box.box (Bool.true))", true, bool)
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn box_and_unbox_record() {