diff options
| author | Kyle Evans <kevans@FreeBSD.org> | 2021-09-23 05:46:30 +0000 |
|---|---|---|
| committer | Kyle Evans <kevans@FreeBSD.org> | 2021-09-29 18:04:57 +0000 |
| commit | f66b9b40f403f7c30fec3c4ceed93c6e8fafa8ac (patch) | |
| tree | 0b73499933418f7d6920207c8bf450bdfa5d0b17 /usr.bin/cmp/tests | |
| parent | 8d546b6832eea031f95f30eaec3232ec1256a281 (diff) | |
Diffstat (limited to 'usr.bin/cmp/tests')
| -rw-r--r-- | usr.bin/cmp/tests/Makefile | 5 | ||||
| -rw-r--r-- | usr.bin/cmp/tests/b_flag.out | 1 | ||||
| -rw-r--r-- | usr.bin/cmp/tests/bl_flag.out | 1 | ||||
| -rwxr-xr-x | usr.bin/cmp/tests/cmp_test2.sh | 17 |
4 files changed, 24 insertions, 0 deletions
diff --git a/usr.bin/cmp/tests/Makefile b/usr.bin/cmp/tests/Makefile index 087f32f4185f..99469ba42243 100644 --- a/usr.bin/cmp/tests/Makefile +++ b/usr.bin/cmp/tests/Makefile @@ -2,9 +2,14 @@ .include <bsd.own.mk> +PACKAGE= tests + ATF_TESTS_SH+= cmp_test2 NETBSD_ATF_TESTS_SH= cmp_test +${PACKAGE}FILES+= b_flag.out +${PACKAGE}FILES+= bl_flag.out + .include <netbsd-tests.test.mk> .include <bsd.test.mk> diff --git a/usr.bin/cmp/tests/b_flag.out b/usr.bin/cmp/tests/b_flag.out new file mode 100644 index 000000000000..bb3d288716b0 --- /dev/null +++ b/usr.bin/cmp/tests/b_flag.out @@ -0,0 +1 @@ +a b differ: char 3, line 1 is 143 c 144 d diff --git a/usr.bin/cmp/tests/bl_flag.out b/usr.bin/cmp/tests/bl_flag.out new file mode 100644 index 000000000000..8ec9007d7ed3 --- /dev/null +++ b/usr.bin/cmp/tests/bl_flag.out @@ -0,0 +1 @@ + 3 143 c 144 d diff --git a/usr.bin/cmp/tests/cmp_test2.sh b/usr.bin/cmp/tests/cmp_test2.sh index 893ee59076c3..c264827646ca 100755 --- a/usr.bin/cmp/tests/cmp_test2.sh +++ b/usr.bin/cmp/tests/cmp_test2.sh @@ -118,6 +118,22 @@ limit_body() atf_check -s exit:1 -o ignore -x "cat a | cmp -sn 5 b -" } +atf_test_case bflag +bflag_head() +{ + atf_set "descr" "Test cmp(1) -b (print bytes)" +} +bflag_body() +{ + echo -n "abcd" > a + echo -n "abdd" > b + + atf_check -s exit:1 -o file:$(atf_get_srcdir)/b_flag.out \ + cmp -b a b + atf_check -s exit:1 -o file:$(atf_get_srcdir)/bl_flag.out \ + cmp -bl a b +} + atf_init_test_cases() { atf_add_test_case special @@ -125,4 +141,5 @@ atf_init_test_cases() atf_add_test_case pr252542 atf_add_test_case skipsuff atf_add_test_case limit + atf_add_test_case bflag } |
