Revert "Add failing test for #346"

This reverts commit 46bbe06d75.
add_libdifftastic
Wilfred Hughes 2022-09-02 10:47:00 +07:00
parent 46bbe06d75
commit df5c787ec7
2 changed files with 4 additions and 6 deletions

@ -10,8 +10,6 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@1.57.0 - uses: dtolnay/rust-toolchain@1.57.0
- run: cargo test - run: cargo test
- name: Run tests when stdout is not a tty
run: cargo test | cat
test_linux_latest_stable: test_linux_latest_stable:
name: Test Linux (latest stable Rust) name: Test Linux (latest stable Rust)

@ -287,7 +287,7 @@ pub fn parse_args() -> Mode {
.parse::<usize>() .parse::<usize>()
.expect("Already validated by clap") .expect("Already validated by clap")
} else { } else {
detect_display_width().unwrap_or(80) detect_display_width()
}; };
let display_mode = if let Some(display_mode_str) = matches.value_of("display") { let display_mode = if let Some(display_mode_str) = matches.value_of("display") {
@ -376,8 +376,8 @@ pub fn parse_args() -> Mode {
/// Choose the display width: try to autodetect, or fall back to a /// Choose the display width: try to autodetect, or fall back to a
/// sensible default. /// sensible default.
fn detect_display_width() -> Option<usize> { fn detect_display_width() -> usize {
terminal_size::terminal_size().map(|(w, _)| w.0 as usize) terminal_size::terminal_size().map_or(80, |(w, _)| w.0 as usize)
} }
pub fn should_use_color(color_output: ColorOutput) -> bool { pub fn should_use_color(color_output: ColorOutput) -> bool {
@ -405,6 +405,6 @@ mod tests {
#[test] #[test]
fn test_detect_display_width() { fn test_detect_display_width() {
// Basic smoke test. // Basic smoke test.
assert!(detect_display_width().is_some()); assert!(detect_display_width() > 10);
} }
} }