From c0b2da7c0119909c43b9c057455334cf0997b045 Mon Sep 17 00:00:00 2001 From: Chris Nikkel Date: Sat, 6 Aug 2016 18:25:11 -0700 Subject: [PATCH] uniq: add test for zero terminated input and output --- .../fixtures/uniq/sorted-zero-terminated.expected | Bin 0 -> 120 bytes tests/fixtures/uniq/sorted-zero-terminated.txt | Bin 0 -> 270 bytes tests/test_uniq.rs | 8 ++++++++ 3 files changed, 8 insertions(+) create mode 100644 tests/fixtures/uniq/sorted-zero-terminated.expected create mode 100644 tests/fixtures/uniq/sorted-zero-terminated.txt diff --git a/tests/fixtures/uniq/sorted-zero-terminated.expected b/tests/fixtures/uniq/sorted-zero-terminated.expected new file mode 100644 index 0000000000000000000000000000000000000000..94081d3640e8b5816049538930c3858ea6a0bc97 GIT binary patch literal 120 zcmY%3OauW1g-5L$6ciW~IFmpC#N7zyCW8Qoy9vxq0RaRz6$B96G!Q^=(?I~ibq4_$ F7XZ{5B^>|& literal 0 HcmV?d00001 diff --git a/tests/fixtures/uniq/sorted-zero-terminated.txt b/tests/fixtures/uniq/sorted-zero-terminated.txt new file mode 100644 index 0000000000000000000000000000000000000000..588f7b076462bbe7c42d8bb3d27539f6df9c9fc3 GIT binary patch literal 270 zcmY%3OauW1g-5L$6ciW~IFmpC#NCLEn+yUV*-c UCommand { static INPUT: &'static str = "sorted.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"; #[test] fn test_stdin_default() { @@ -92,3 +93,10 @@ fn test_stdin_repeated_only() { .args(&["-d"]).pipe_in_fixture(INPUT) .run().stdout_is_fixture("sorted-repeated-only.expected"); } + +#[test] +fn test_stdin_zero_terminated() { + new_ucmd() + .args(&["-z"]).pipe_in_fixture(SORTED_ZERO_TERMINATED) + .run().stdout_is_fixture("sorted-zero-terminated.expected"); +} \ No newline at end of file