mono: generate Eq functions for Boxed layout

This commit is contained in:
Brian Carroll 2022-07-03 18:42:35 +01:00
parent 817ffba982
commit 7c7e450756
No known key found for this signature in database
GPG key ID: 9CF4E3BF9C4722C7
4 changed files with 65 additions and 11 deletions

View file

@ -672,3 +672,25 @@ fn compare_nullable_recursive_union_same_content() {
bool
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn boxed_eq_int() {
assert_evals_to!("Box.box 1 == Box.box 1", true, bool);
assert_evals_to!("Box.box 2 == Box.box 1", false, bool);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn boxed_eq_str() {
assert_evals_to!(
"Box.box \"Hello, world\" == Box.box \"Hello, world\"",
true,
bool
);
assert_evals_to!(
"Box.box \"Hello, world\" == Box.box \"Hello, stranger\"",
false,
bool
);
}