Skip to content

Commit

Permalink
Add testcases for cat -b
Browse files Browse the repository at this point in the history
MFC after:	1 month
Sponsored by:	Dell EMC Isilon
  • Loading branch information
ngie-eign committed Jun 6, 2017
1 parent 366dbfa commit 7c91b65
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/cat/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ NETBSD_ATF_TESTS_SH= cat_test

${PACKAGE}FILES+= d_align.in
${PACKAGE}FILES+= d_align.out
${PACKAGE}FILES+= d_b_output.in
${PACKAGE}FILES+= d_b_output.out
${PACKAGE}FILES+= d_se_output.in
${PACKAGE}FILES+= d_se_output.out
${PACKAGE}FILES+= d_s_output.in
Expand Down
4 changes: 4 additions & 0 deletions contrib/netbsd-tests/bin/cat/d_b_output.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This is a line

The line before this was a blank line.
This line has leading whitespace.
4 changes: 4 additions & 0 deletions contrib/netbsd-tests/bin/cat/d_b_output.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
1 This is a line

2 The line before this was a blank line.
3 This line has leading whitespace.
16 changes: 16 additions & 0 deletions contrib/netbsd-tests/bin/cat/t_cat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,19 @@ nonexistent_body() {
-x "cat /some/name/that/does/not/exist"
}

# Begin FreeBSD
atf_test_case b_output
b_output_head() {
atf_set "descr" "Test that cat(1) prints out numbers on non-blank "\
"lines with '-b'"
}

b_output_body() {
atf_check -o file:$(atf_get_srcdir)/d_b_output.out \
cat -b $(atf_get_srcdir)/d_b_output.in
}
# End FreeBSD

atf_test_case se_output
se_output_head() {
atf_set "descr" "Test that cat(1) prints a $ sign " \
Expand Down Expand Up @@ -103,6 +116,9 @@ atf_init_test_cases()
{
atf_add_test_case align
atf_add_test_case nonexistent
# Begin FreeBSD
atf_add_test_case b_output
# End FreeBSD
atf_add_test_case se_output
# Begin FreeBSD
atf_add_test_case s_output
Expand Down

0 comments on commit 7c91b65

Please sign in to comment.