wasm: enable remaining List tests, except 2 panics

This commit is contained in:
Brian Carroll 2022-07-06 00:26:52 +01:00
parent f132350ef3
commit 617e18af98
No known key found for this signature in database
GPG key ID: 9CF4E3BF9C4722C7

View file

@ -307,8 +307,9 @@ fn list_split() {
(RocList<i64>, RocList<i64>,)
);
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_drop() {
assert_evals_to!(
"List.drop [1,2,3] 2",
@ -353,7 +354,7 @@ fn list_drop_at() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_intersperse() {
assert_evals_to!(
indoc!(
@ -398,7 +399,7 @@ fn list_drop_at_shared() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_drop_if_empty_list_of_int() {
assert_evals_to!(
indoc!(
@ -415,7 +416,7 @@ fn list_drop_if_empty_list_of_int() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_drop_if_empty_list() {
assert_evals_to!(
indoc!(
@ -432,7 +433,7 @@ fn list_drop_if_empty_list() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_drop_if_always_false_for_non_empty_list() {
assert_evals_to!(
indoc!(
@ -446,7 +447,7 @@ fn list_drop_if_always_false_for_non_empty_list() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_drop_if_always_true_for_non_empty_list() {
assert_evals_to!(
indoc!(
@ -460,7 +461,7 @@ fn list_drop_if_always_true_for_non_empty_list() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_drop_if_geq3() {
assert_evals_to!(
indoc!(
@ -474,7 +475,7 @@ fn list_drop_if_geq3() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_drop_if_string_eq() {
assert_evals_to!(
indoc!(
@ -488,7 +489,7 @@ fn list_drop_if_string_eq() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_drop_last() {
assert_evals_to!(
"List.dropLast [1, 2, 3]",
@ -508,7 +509,7 @@ fn list_drop_last() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_drop_last_mutable() {
assert_evals_to!(
indoc!(
@ -530,7 +531,7 @@ fn list_drop_last_mutable() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_drop_first() {
assert_evals_to!(
"List.dropFirst [1, 2, 3]",
@ -841,7 +842,7 @@ fn list_walk_until_even_prefix_sum() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_keep_if_empty_list_of_int() {
assert_evals_to!(
indoc!(
@ -859,7 +860,7 @@ fn list_keep_if_empty_list_of_int() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_keep_if_empty_list() {
assert_evals_to!(
indoc!(
@ -878,7 +879,7 @@ fn list_keep_if_empty_list() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_keep_if_always_true_for_non_empty_list() {
assert_evals_to!(
indoc!(
@ -900,7 +901,7 @@ fn list_keep_if_always_true_for_non_empty_list() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_keep_if_always_false_for_non_empty_list() {
assert_evals_to!(
indoc!(
@ -918,7 +919,7 @@ fn list_keep_if_always_false_for_non_empty_list() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_keep_if_one() {
assert_evals_to!(
indoc!(
@ -936,7 +937,7 @@ fn list_keep_if_one() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_keep_if_str_is_hello() {
assert_evals_to!(
indoc!(
@ -2496,7 +2497,7 @@ fn list_product() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_keep_void() {
assert_evals_to!(
"List.keepOks [] (\\x -> x)",
@ -2512,7 +2513,7 @@ fn list_keep_void() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_keep_oks() {
assert_evals_to!(
"List.keepOks [Ok {}, Ok {}] (\\x -> x)",
@ -2537,7 +2538,7 @@ fn list_keep_oks() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_keep_errs() {
assert_evals_to!(
"List.keepErrs [Err {}, Err {}] (\\x -> x)",
@ -2712,7 +2713,7 @@ fn list_all_empty_with_unknown_element_type() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[should_panic(expected = r#"Roc failed with message: "invalid ret_layout""#)]
fn lists_with_incompatible_type_param_in_if() {
assert_evals_to!(
@ -2777,7 +2778,7 @@ fn empty_list_of_function_type() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_join_map() {
assert_evals_to!(
indoc!(
@ -2797,7 +2798,7 @@ fn list_join_map() {
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn list_join_map_empty() {
assert_evals_to!(
indoc!(