mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
mono: generate Eq functions for Boxed layout
This commit is contained in:
parent
817ffba982
commit
7c7e450756
4 changed files with 65 additions and 11 deletions
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue