Skip to content

Commit

Permalink
Add (failing) test for Sort code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
jwoudenberg committed Jun 16, 2024
1 parent 188ee05 commit 3aad292
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions crates/compiler/test_gen/src/gen_compare.rs
Original file line number Diff line number Diff line change
@@ -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
);
}
1 change: 1 addition & 0 deletions crates/compiler/test_gen/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3aad292

Please sign in to comment.