1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

refactor(uniq): Move to clap + add a test (#1626)

This commit is contained in:
Sylvestre Ledru 2020-11-21 09:52:40 +01:00 committed by GitHub
parent 7bbb4c98e8
commit 41ba5ed913
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 151 additions and 100 deletions

View file

@ -1,6 +1,7 @@
use crate::common::util::*;
static INPUT: &'static str = "sorted.txt";
static OUTPUT: &'static str = "sorted-output.txt";
static SKIP_CHARS: &'static str = "skip-chars.txt";
static SKIP_FIELDS: &'static str = "skip-fields.txt";
static SORTED_ZERO_TERMINATED: &'static str = "sorted-zero-terminated.txt";
@ -21,6 +22,15 @@ fn test_single_default() {
.stdout_is_fixture("sorted-simple.expected");
}
#[test]
fn test_single_default_output() {
let (at, mut ucmd) = at_and_ucmd!();
let expected = at.read("sorted-simple.expected");
ucmd.args(&[INPUT, OUTPUT]).run();
let found = at.read(OUTPUT);
assert_eq!(found, expected);
}
#[test]
fn test_stdin_counts() {
new_ucmd!()