diff --git a/Cargo.lock b/Cargo.lock index d2babf3e7b..71b9a3e355 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3737,7 +3737,6 @@ dependencies = [ "roc_target", "roc_types", "roc_unify", - "strip-ansi-escapes", "tempfile", "ven_pretty", ] @@ -4526,6 +4525,7 @@ dependencies = [ "roc_load", "roc_module", "roc_mono", + "roc_reporting", "roc_target", "test_mono_macros", ] diff --git a/compiler/load_internal/Cargo.toml b/compiler/load_internal/Cargo.toml index 5381fc94b9..3d876623f5 100644 --- a/compiler/load_internal/Cargo.toml +++ b/compiler/load_internal/Cargo.toml @@ -33,4 +33,3 @@ tempfile = "3.2.0" pretty_assertions = "1.0.0" maplit = "1.0.2" indoc = "1.0.3" -strip-ansi-escapes = "0.1.1" diff --git a/compiler/load_internal/tests/test_load.rs b/compiler/load_internal/tests/test_load.rs index 8f0223d483..9cc4a46721 100644 --- a/compiler/load_internal/tests/test_load.rs +++ b/compiler/load_internal/tests/test_load.rs @@ -25,6 +25,7 @@ mod test_load { use roc_problem::can::Problem; use roc_region::all::LineInfo; use roc_reporting::report::can_problem; + use roc_reporting::report::RenderTarget; use roc_reporting::report::RocDocAllocator; use roc_target::TargetInfo; use roc_types::pretty_print::{content_to_string, name_all_type_vars}; @@ -41,7 +42,7 @@ mod test_load { ) -> Result> { use LoadResult::*; - let load_start = LoadStart::from_path(arena, filename)?; + let load_start = LoadStart::from_path(arena, filename, RenderTarget::Generic)?; match roc_load_internal::file::load( arena, @@ -51,6 +52,7 @@ mod test_load { Phase::SolveTypes, target_info, Default::default(), // these tests will re-compile the builtins + RenderTarget::Generic, )? { Monomorphized(_) => unreachable!(""), TypeChecked(module) => Ok(module), @@ -88,8 +90,6 @@ mod test_load { } fn multiple_modules(files: Vec<(&str, &str)>) -> Result { - use roc_load_internal::file::LoadingProblem; - let arena = Bump::new(); let arena = &arena; @@ -589,18 +589,18 @@ mod test_load { report, indoc!( " - \u{1b}[36m── UNFINISHED LIST ─────────────────────────────────────────────────────────────\u{1b}[0m + ── UNFINISHED LIST ───────────────────────────────────────────────────────────── - I cannot find the end of this list: + I cannot find the end of this list: - \u{1b}[36m3\u{1b}[0m\u{1b}[36m│\u{1b}[0m \u{1b}[37mmain = [\u{1b}[0m - \u{1b}[31m^\u{1b}[0m + 3│ main = [ + ^ - You could change it to something like \u{1b}[33m[ 1, 2, 3 ]\u{1b}[0m or even just \u{1b}[33m[]\u{1b}[0m. - Anything where there is an open and a close square bracket, and where - the elements of the list are separated by commas. + You could change it to something like [ 1, 2, 3 ] or even just []. + Anything where there is an open and a close square bracket, and where + the elements of the list are separated by commas. - \u{1b}[4mNote\u{1b}[0m: I may be confused by indentation" + Note: I may be confused by indentation" ) ), Ok(_) => unreachable!("we expect failure here"), @@ -769,8 +769,6 @@ mod test_load { ]; let err = multiple_modules(modules).unwrap_err(); - let err = strip_ansi_escapes::strip(err).unwrap(); - let err = String::from_utf8(err).unwrap(); assert_eq!( err, indoc!( diff --git a/compiler/test_gen/src/helpers/llvm.rs b/compiler/test_gen/src/helpers/llvm.rs index f6660f977b..03bc6b7a1e 100644 --- a/compiler/test_gen/src/helpers/llvm.rs +++ b/compiler/test_gen/src/helpers/llvm.rs @@ -7,6 +7,7 @@ use roc_collections::all::MutSet; use roc_gen_llvm::llvm::externs::add_default_roc_externs; use roc_mono::ir::OptLevel; use roc_region::all::LineInfo; +use roc_reporting::report::RenderTarget; use target_lexicon::Triple; fn promote_expr_to_module(src: &str) -> String { @@ -57,6 +58,7 @@ fn create_llvm_module<'a>( src_dir, Default::default(), target_info, + RenderTarget::ColorTerminal, ); let mut loaded = match loaded { diff --git a/compiler/test_mono/Cargo.toml b/compiler/test_mono/Cargo.toml index 2f56668cb1..9f336dbe73 100644 --- a/compiler/test_mono/Cargo.toml +++ b/compiler/test_mono/Cargo.toml @@ -17,6 +17,7 @@ roc_load = { path = "../load" } roc_can = { path = "../can" } roc_mono = { path = "../mono" } roc_target = { path = "../roc_target" } +roc_reporting = { path = "../../reporting" } test_mono_macros = { path = "../test_mono_macros" } pretty_assertions = "1.0.0" bumpalo = { version = "3.8.0", features = ["collections"] } diff --git a/compiler/test_mono/src/tests.rs b/compiler/test_mono/src/tests.rs index 777a790d52..74e17f9a15 100644 --- a/compiler/test_mono/src/tests.rs +++ b/compiler/test_mono/src/tests.rs @@ -101,6 +101,7 @@ fn compiles_to_ir(test_name: &str, src: &str) { src_dir, Default::default(), TARGET_INFO, + roc_reporting::report::RenderTarget::Generic, ); let mut loaded = match loaded { diff --git a/reporting/tests/test_reporting.rs b/reporting/tests/test_reporting.rs index 675a259de0..84e0509b5d 100644 --- a/reporting/tests/test_reporting.rs +++ b/reporting/tests/test_reporting.rs @@ -9462,4 +9462,29 @@ I need all branches in an `if` to have the same type! ), ) } + + #[test] + fn ability_specialization_is_incomplete() { + new_report_problem_as( + indoc!( + r#" + app "test" provides [ eq, le ] to "./platform" + + Eq has + eq : a, a -> Bool | a has Eq + le : a, a -> Bool | a has Eq + + Id := U64 + + eq = \$Id m, $Id n -> m == n + + le = \$Id m, $Id n -> m < n + "# + ), + indoc!( + r#" + "# + ), + ) + } }