From 0e7f1c4c0df20546e3812075d8e25a39861f607f Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Sun, 24 Jul 2022 21:40:38 -0700 Subject: [PATCH] Add missing testcases for `wc`. --- tests/by-util/test_wc.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/by-util/test_wc.rs b/tests/by-util/test_wc.rs index 9662d6c93..9f509183c 100644 --- a/tests/by-util/test_wc.rs +++ b/tests/by-util/test_wc.rs @@ -104,6 +104,33 @@ fn test_utf8_chars() { .stdout_is("442\n"); } +#[test] +fn test_utf8_bytes_chars() { + new_ucmd!() + .arg("-cm") + .pipe_in_fixture("UTF_8_weirdchars.txt") + .run() + .stdout_is(" 442 513\n"); +} + +#[test] +fn test_utf8_bytes_lines() { + new_ucmd!() + .arg("-cl") + .pipe_in_fixture("UTF_8_weirdchars.txt") + .run() + .stdout_is(" 25 513\n"); +} + +#[test] +fn test_utf8_bytes_chars_lines() { + new_ucmd!() + .arg("-cml") + .pipe_in_fixture("UTF_8_weirdchars.txt") + .run() + .stdout_is(" 25 442 513\n"); +} + #[test] fn test_utf8_chars_words() { new_ucmd!()