remove assert_non_opt_evals_to

This commit is contained in:
Folkert 2022-07-24 12:12:28 +02:00
parent e1b427839b
commit f5c23a219a
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 40 additions and 75 deletions

View file

@ -1,23 +1,11 @@
#[cfg(feature = "gen-llvm")]
use crate::helpers::llvm::assert_evals_to;
#[cfg(feature = "gen-llvm")]
use crate::helpers::llvm::assert_non_opt_evals_to;
#[cfg(feature = "gen-dev")]
use crate::helpers::dev::assert_evals_to;
// #[cfg(feature = "gen-dev")]
// use crate::helpers::dev::assert_evals_to as assert_llvm_evals_to;
// #[cfg(feature = "gen-dev")]
// use crate::helpers::dev::assert_evals_to as assert_non_opt_evals_to;
#[cfg(feature = "gen-wasm")]
use crate::helpers::wasm::assert_evals_to;
#[cfg(feature = "gen-wasm")]
use crate::helpers::wasm::assert_evals_to as assert_non_opt_evals_to;
// #[cfg(feature = "gen-wasm")]
// use crate::helpers::wasm::assert_evals_to as assert_llvm_evals_to;
// #[cfg(feature = "gen-wasm")]
// use crate::helpers::wasm::assert_evals_to as assert_non_opt_evals_to;
use indoc::indoc;
#[allow(unused_imports)]
@ -528,7 +516,7 @@ fn factorial() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn peano1() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
Peano : [S Peano, Z]
@ -549,7 +537,7 @@ fn peano1() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn peano2() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
Peano : [S Peano, Z]
@ -611,7 +599,7 @@ fn top_level_destructure() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_len_0() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -639,7 +627,7 @@ fn linked_list_len_0() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_len_twice_0() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -667,7 +655,7 @@ fn linked_list_len_twice_0() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_len_1() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -695,7 +683,7 @@ fn linked_list_len_1() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_len_twice_1() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -723,7 +711,7 @@ fn linked_list_len_twice_1() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_len_3() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -752,7 +740,7 @@ fn linked_list_len_3() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_sum_num_a() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -781,7 +769,7 @@ fn linked_list_sum_num_a() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_sum_int() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -809,7 +797,7 @@ fn linked_list_sum_int() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_map() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -900,7 +888,7 @@ fn when_nested_maybe() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn when_peano() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
Peano : [S Peano, Z]
@ -918,7 +906,7 @@ fn when_peano() {
i64
);
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
Peano : [S Peano, Z]
@ -936,7 +924,7 @@ fn when_peano() {
i64
);
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
Peano : [S Peano, Z]
@ -1123,7 +1111,7 @@ fn specialize_closure() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn io_poc_effect() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1182,7 +1170,7 @@ fn io_poc_desugared() {
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn return_wrapped_function_pointer() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1205,7 +1193,7 @@ fn return_wrapped_function_pointer() {
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn return_wrapped_function_pointer_b() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1227,7 +1215,7 @@ fn return_wrapped_function_pointer_b() {
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn return_wrapped_closure() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1253,7 +1241,7 @@ fn return_wrapped_closure() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_is_singleton() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1288,7 +1276,7 @@ fn linked_list_is_singleton() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_is_empty_1() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1323,7 +1311,7 @@ fn linked_list_is_empty_1() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_is_empty_2() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1356,7 +1344,7 @@ fn linked_list_is_empty_2() {
#[cfg(any(feature = "gen-llvm"))]
fn linked_list_singleton() {
// verifies only that valid llvm is produced
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1376,7 +1364,7 @@ fn linked_list_singleton() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn recursive_function_with_rigid() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1403,7 +1391,7 @@ fn recursive_function_with_rigid() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn rbtree_insert() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1491,7 +1479,7 @@ fn rbtree_insert() {
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn rbtree_balance_3() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1518,7 +1506,7 @@ fn rbtree_balance_3() {
#[ignore]
fn rbtree_layout_issue() {
// there is a flex var in here somewhere that blows up layout creation
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1565,7 +1553,7 @@ fn rbtree_balance_mono_problem() {
// problem. As a result, the first argument is dropped and we run into issues down the line
//
// concretely, the `rRight` symbol will not be defined
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1612,7 +1600,7 @@ fn rbtree_balance_mono_problem() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn rbtree_balance_full() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1665,7 +1653,7 @@ fn rbtree_balance_full() {
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn nested_pattern_match_two_ways() {
// exposed an issue in the ordering of pattern match checks when ran with `--release` mode
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1691,7 +1679,7 @@ fn nested_pattern_match_two_ways() {
i64
);
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1720,7 +1708,7 @@ fn nested_pattern_match_two_ways() {
fn linked_list_guarded_double_pattern_match() {
// the important part here is that the first case (with the nested Cons) does not match
// TODO this also has undefined behavior
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1750,7 +1738,7 @@ fn linked_list_guarded_double_pattern_match() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn linked_list_double_pattern_match() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1776,7 +1764,7 @@ fn linked_list_double_pattern_match() {
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn binary_tree_double_pattern_match() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1804,7 +1792,7 @@ fn binary_tree_double_pattern_match() {
fn unified_empty_closure_bool() {
// none of the Closure tags will have a payload
// this was not handled correctly in the past
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1829,7 +1817,7 @@ fn unified_empty_closure_bool() {
fn unified_empty_closure_byte() {
// none of the Closure tags will have a payload
// this was not handled correctly in the past
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1853,7 +1841,7 @@ fn unified_empty_closure_byte() {
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn task_always_twice() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1898,7 +1886,7 @@ fn task_always_twice() {
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn wildcard_rigid() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1928,7 +1916,7 @@ fn wildcard_rigid() {
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn alias_of_alias_with_type_arguments() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -1958,7 +1946,7 @@ fn alias_of_alias_with_type_arguments() {
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[ignore]
fn todo_bad_error_message() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -2061,7 +2049,7 @@ fn unsupported_pattern_str_interp() {
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[ignore]
fn fingertree_basic() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"
@ -2124,7 +2112,7 @@ fn case_or_pattern() {
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[ignore]
fn rosetree_basic() {
assert_non_opt_evals_to!(
assert_evals_to!(
indoc!(
r#"
app "test" provides [main] to "./platform"

View file

@ -622,34 +622,11 @@ pub fn identity<T>(value: T) -> T {
value
}
#[allow(unused_macros)]
macro_rules! assert_non_opt_evals_to {
($src:expr, $expected:expr, $ty:ty) => {{
$crate::helpers::llvm::assert_llvm_evals_to!(
$src,
$expected,
$ty,
$crate::helpers::llvm::identity
);
}};
($src:expr, $expected:expr, $ty:ty, $transform:expr) => {
// Same as above, except with an additional transformation argument.
{
$crate::helpers::llvm::assert_llvm_evals_to!($src, $expected, $ty, $transform);
}
};
($src:expr, $expected:expr, $ty:ty, $transform:expr) => {{
$crate::helpers::llvm::assert_llvm_evals_to!($src, $expected, $ty, $transform);
}};
}
#[allow(unused_imports)]
pub(crate) use assert_evals_to;
#[allow(unused_imports)]
pub(crate) use assert_llvm_evals_to;
#[allow(unused_imports)]
pub(crate) use assert_non_opt_evals_to;
#[allow(unused_imports)]
pub(crate) use assert_wasm_evals_to;
#[allow(unused_imports)]
pub(crate) use expect_runtime_error_panic;