lightsystemdarkgreen
@ 261119.3 · fetching

261117.3 514d1c6139b9a72f18f53ac8ff5de6ced0f0ff76 Fix tests failing when run in a terminal (#2343)

* Fix test_terminal_color_mode_from_env_var_when_stdout_is_not_the_terminal failing when tests run in a terminal

Under a terminal the test took the path that asks the terminal for its colors, which tests do not do, and ignored DELTA_TERMINAL_COLOR_MODE. Tests now behave as if stdout were not a terminal, wherever they are run.

Fixes #2341

* Fix a compiler warning about an unused formatting placeholder in a test

delta uses Rust edition 2018, where assert!'s message is not a format string unless it has arguments, so "{help}" was printed literally.

reading declarations

Changes to src/cli.rs. All files

src/cli.rs

@@ -1550,6 +1550,6 @@ mod tests {     #[test]     fn help_lists_tui() {         let help = Opt::command().render_help().to_string();-        assert!(help.contains("--tui"), "{help}");+        assert!(help.contains("--tui"), "{}", help);     } }