diff --git a/crates/compiler/test_gen/src/gen_compare.rs b/crates/compiler/test_gen/src/gen_compare.rs new file mode 100644 index 00000000000..c528b49921a --- /dev/null +++ b/crates/compiler/test_gen/src/gen_compare.rs @@ -0,0 +1,33 @@ +#[cfg(feature = "gen-llvm")] +use crate::helpers::llvm::assert_evals_to; + +#[cfg(feature = "gen-dev")] +use crate::helpers::dev::assert_evals_to; + +#[cfg(feature = "gen-wasm")] +use crate::helpers::wasm::assert_evals_to; + +use indoc::indoc; + +#[test] +#[cfg(any(feature = "gen-llvm", feature = "gen-dev", feature = "gen-wasm"))] +fn compare_i64() { + assert_evals_to!( + indoc!( + r#" + i : I64 + i = 1 + + j : I64 + j = 2 + + when List.compare i j is + Equals -> 0 + GreaterThan -> 1 + LessThan -> 2 + "# + ), + 2, + i64 + ); +} diff --git a/crates/compiler/test_gen/src/tests.rs b/crates/compiler/test_gen/src/tests.rs index 3338b02447d..55e48a5a748 100644 --- a/crates/compiler/test_gen/src/tests.rs +++ b/crates/compiler/test_gen/src/tests.rs @@ -5,6 +5,7 @@ #![allow(clippy::float_cmp)] pub mod gen_abilities; +pub mod gen_compare; pub mod gen_definitions; pub mod gen_dict; pub mod gen_equality;