diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1087,6 +1087,8 @@ .. col .. + column + .. comm .. compress diff --git a/usr.bin/column/Makefile b/usr.bin/column/Makefile --- a/usr.bin/column/Makefile +++ b/usr.bin/column/Makefile @@ -1,3 +1,8 @@ +.include + PROG= column +HAS_TESTS= +SUBDIR.${MK_TESTS}= tests + .include diff --git a/usr.bin/column/tests/Makefile b/usr.bin/column/tests/Makefile new file mode 100644 --- /dev/null +++ b/usr.bin/column/tests/Makefile @@ -0,0 +1,3 @@ +ATF_TESTS_SH= column + +.include diff --git a/usr.bin/column/tests/column.sh b/usr.bin/column/tests/column.sh new file mode 100644 --- /dev/null +++ b/usr.bin/column/tests/column.sh @@ -0,0 +1,170 @@ +# SPDX-License-Identifier: ISC +# +# Copyright (c) 2025 Lexi Winter +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +atf_test_case "basic" +basic_head() +{ + atf_set descr "Basic column(1) with default options" +} + +basic_body() +{ + cat >input.1 <input.2 <input.3 <expected <input.1 <input.2 <input.3 <expected <input.1 <input.2 <input.3 <expected <input <expected <