From 34e24fa2ba751affdb5c6e8372372911aa30ec9a Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Thu, 23 Dec 2021 19:28:02 -0800 Subject: [PATCH] improve test_reporting error reports --- Cargo.lock | 1 + reporting/Cargo.toml | 1 + reporting/tests/test_reporting.rs | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 44b65c1fc8..1548053545 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3671,6 +3671,7 @@ dependencies = [ "roc_problem", "roc_region", "roc_solve", + "roc_test_utils", "roc_types", "ven_pretty", ] diff --git a/reporting/Cargo.toml b/reporting/Cargo.toml index 7fa1d2cfee..195406c968 100644 --- a/reporting/Cargo.toml +++ b/reporting/Cargo.toml @@ -24,5 +24,6 @@ roc_constrain = { path = "../compiler/constrain" } roc_builtins = { path = "../compiler/builtins" } roc_problem = { path = "../compiler/problem" } roc_parse = { path = "../compiler/parse" } +roc_test_utils = { path = "../test_utils" } pretty_assertions = "1.0.0" indoc = "1.0.3" diff --git a/reporting/tests/test_reporting.rs b/reporting/tests/test_reporting.rs index 8c5dfbe506..aabc59ec80 100644 --- a/reporting/tests/test_reporting.rs +++ b/reporting/tests/test_reporting.rs @@ -23,6 +23,7 @@ mod test_reporting { }; use roc_reporting::report::{RocDocAllocator, RocDocBuilder}; use roc_solve::solve; + use roc_test_utils::assert_multiline_str_eq; use roc_types::pretty_print::name_all_type_vars; use roc_types::subs::Subs; use std::path::PathBuf; @@ -236,7 +237,7 @@ mod test_reporting { } } - assert_eq!(buf, expected_rendering); + assert_multiline_str_eq!(expected_rendering, buf.as_str()); } fn report_header_problem_as(src: &str, expected_rendering: &str) {