From aa0a0bf06832be6fa1bce1f09500c8503f309a50 Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Tue, 28 Apr 2026 16:23:02 -0700 Subject: [PATCH] DUX-5112 Add `can_write_error_log_repl_no_load` test Test for #438. --- tests/error_log.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/error_log.rs b/tests/error_log.rs index 926f7706..6e3e0165 100644 --- a/tests/error_log.rs +++ b/tests/error_log.rs @@ -30,6 +30,32 @@ async fn can_write_error_log() { .assert_eq(&error_contents); } +/// Test that `ghciwatch --errors ...` can write the error log with `--repl-no-load`. +#[test] +async fn can_write_error_log_repl_no_load() { + let error_path = "ghcid.txt"; + let mut session = GhciWatchBuilder::new("tests/data/simple") + .with_args(["--errors", error_path]) + .with_cabal_arg("--repl-no-load") + .start() + .await + .expect("ghciwatch starts"); + let error_path = session.path(error_path); + session + .wait_until_ready() + .await + .expect("ghciwatch loads ghci"); + let error_contents = session + .fs() + .read(&error_path) + .await + .expect("ghciwatch writes ghcid.txt"); + expect![[r#" + All good (0 modules) + "#]] + .assert_eq(&error_contents); +} + /// Test that `ghciwatch --errors ...` can write compilation errors. /// Then, test that it can reload when modules are changed and will correctly rewrite the error log /// once it's fixed.