Bump expect to run Rust fn

This commit is contained in:
Joshua Hoeflich 2021-08-28 11:10:02 -05:00
parent 93b77a840a
commit 4e57b1edf2
2 changed files with 11 additions and 2 deletions

View File

@ -4447,6 +4447,11 @@ fn run_higher_order_low_level<'a, 'ctx, 'env>(
}
}
// TODO: Fix me! I should be different in tests vs. user code!
fn expect_failed() {
panic!("An expectation failed!");
}
#[allow(clippy::too_many_arguments)]
fn run_low_level<'a, 'ctx, 'env>(
env: &Env<'a, 'ctx, 'env>,
@ -4457,6 +4462,7 @@ fn run_low_level<'a, 'ctx, 'env>(
op: LowLevel,
args: &[Symbol],
update_mode: Option<UpdateMode>,
// expect_failed: *const (),
) -> BasicValueEnum<'ctx> {
use LowLevel::*;
@ -5177,7 +5183,10 @@ fn run_low_level<'a, 'ctx, 'env>(
call_void_bitcode_fn(
env,
&[env.ptr_int().const_int(0 as u64, false).into()],
&[env
.ptr_int()
.const_int(expect_failed as *const () as u64, false)
.into()],
bitcode::EXPECT_FAILED,
);

View File

@ -2398,7 +2398,7 @@ fn call_invalid_layout() {
}
#[test]
// #[should_panic(expected = "assert failed!")]
#[should_panic(expected = "An expectation failed!")]
fn expect_fail() {
assert_evals_to!(
indoc!(