mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
parent
f43e346897
commit
c1d4a18c00
5 changed files with 552 additions and 654 deletions
|
@ -93,7 +93,6 @@ pub fn get_values<'a>(
|
|||
mod test {
|
||||
use indoc::indoc;
|
||||
use pretty_assertions::assert_eq;
|
||||
use roc_error_macros::internal_error;
|
||||
use roc_gen_llvm::{llvm::build::LlvmBackendMode, run_roc::RocCallResult, run_roc_dylib};
|
||||
use roc_load::{ExecutionMode, LoadConfig, LoadMonomorphizedError, Threading};
|
||||
use roc_packaging::cache::RocCacheDir;
|
||||
|
@ -137,9 +136,9 @@ mod test {
|
|||
) {
|
||||
Ok(m) => m,
|
||||
Err(LoadMonomorphizedError::ErrorModule(m)) => {
|
||||
internal_error!("{:?}", (m.can_problems, m.type_problems))
|
||||
panic!("{:?}", (m.can_problems, m.type_problems))
|
||||
}
|
||||
Err(e) => internal_error!("{e:?}"),
|
||||
Err(e) => panic!("{e:?}"),
|
||||
};
|
||||
|
||||
let mut loaded = loaded;
|
||||
|
|
|
@ -327,7 +327,7 @@ fn run_expect_fx<'a, W: std::io::Write>(
|
|||
try_run_jit_function!(lib, expect.name, (), |v: ()| v);
|
||||
|
||||
if let Err((msg, _)) = result {
|
||||
internal_error!("roc panic {}", msg);
|
||||
panic!("roc panic {}", msg);
|
||||
}
|
||||
|
||||
if sequence.count_failures() > 0 {
|
||||
|
@ -518,7 +518,7 @@ fn render_dbg_failure<'a>(
|
|||
let data = expectations.get_mut(&module_id).unwrap();
|
||||
|
||||
let current = match data.dbgs.get(&dbg_symbol) {
|
||||
None => internal_error!("region {failure_region:?} not in list of dbgs"),
|
||||
None => panic!("region {failure_region:?} not in list of dbgs"),
|
||||
Some(current) => current,
|
||||
};
|
||||
let failure_region = current.region;
|
||||
|
@ -565,7 +565,7 @@ fn render_expect_failure<'a>(
|
|||
let data = expectations.get_mut(&module_id).unwrap();
|
||||
|
||||
let current = match data.expectations.get(&failure_region) {
|
||||
None => internal_error!("region {failure_region:?} not in list of expects"),
|
||||
None => panic!("region {failure_region:?} not in list of expects"),
|
||||
Some(current) => current,
|
||||
};
|
||||
|
||||
|
@ -638,7 +638,7 @@ impl ExpectSequence {
|
|||
0 => std::hint::spin_loop(),
|
||||
1 => break ChildProcessMsg::Expect,
|
||||
2 => break ChildProcessMsg::Dbg,
|
||||
n => internal_error!("invalid atomic value set by the child: {:#x}", n),
|
||||
n => panic!("invalid atomic value set by the child: {:#x}", n),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -815,7 +815,7 @@ pub fn expect_mono_module_to_dylib<'a>(
|
|||
if let Err(errors) = env.module.verify() {
|
||||
let path = std::env::temp_dir().join("test.ll");
|
||||
env.module.print_to_file(&path).unwrap();
|
||||
internal_error!(
|
||||
panic!(
|
||||
"Errors defining module:\n{}\n\nUncomment things nearby to see more details. IR written to `{:?}`",
|
||||
errors.to_string(), path,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue