From 233d009d12fffb78744a6bf6d445a4170bee5034 Mon Sep 17 00:00:00 2001 From: Pei Yang Ching <59727193+horriblename@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:01:20 +0200 Subject: [PATCH] add tests for `roc test --ignore-build-errors` --- crates/cli/tests/cli_run.rs | 14 ++++++++++++++ crates/cli/tests/expects/IgnoreBuildErrors.roc | 12 ++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 crates/cli/tests/expects/IgnoreBuildErrors.roc diff --git a/crates/cli/tests/cli_run.rs b/crates/cli/tests/cli_run.rs index 5fd18707d3a..e6d65b01d7c 100644 --- a/crates/cli/tests/cli_run.rs +++ b/crates/cli/tests/cli_run.rs @@ -646,6 +646,20 @@ mod cli_run { ); } + #[test] + fn expect_ignore_build_errors() { + test_roc_expect( + "crates/cli/tests/expects", + "IgnoreBuildErrors.roc", + &["--ignore-build-errors"], + indoc!( + r#" + 1 failed and 1 passed in ms. + "# + ), + ) + } + #[test] #[cfg_attr(windows, ignore)] fn transitive_expects() { diff --git a/crates/cli/tests/expects/IgnoreBuildErrors.roc b/crates/cli/tests/expects/IgnoreBuildErrors.roc new file mode 100644 index 00000000000..8f0136d7a82 --- /dev/null +++ b/crates/cli/tests/expects/IgnoreBuildErrors.roc @@ -0,0 +1,12 @@ +interface IgnoreBuildErrors + exposes [] + imports [] + +x = 1 + +expect x == 1 + +foo = \x -> x + 1 + +expect foo 2 == 3 +