handle all comparison widths

This commit is contained in:
Folkert 2023-04-08 18:24:33 +02:00
parent 9dd69f6f9c
commit fdffcc8b36
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
5 changed files with 283 additions and 110 deletions

View file

@ -15,6 +15,40 @@ use indoc::indoc;
#[allow(unused_imports)]
use roc_std::{RocList, RocResult, RocStr};
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn string_eq() {
// context: the dev backend did not correctly mask the boolean that zig returns here
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
main : I64
main = if "*" == "*" then 123 else 456
"#
),
123,
u64
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
fn string_neq() {
// context: the dev backend did not correctly mask the boolean that zig returns here
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
main : I64
main = if "*" != "*" then 123 else 456
"#
),
456,
u64
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-dev"))]
fn str_split_empty_delimiter() {

View file

@ -210,7 +210,7 @@ pub fn helper(
let builtins_host_tempfile =
roc_bitcode::host_tempfile().expect("failed to write host builtins object to tempfile");
if false {
if true {
std::fs::copy(&app_o_file, "/tmp/app.o").unwrap();
}