1316501Sasomers# Copyright (c) 2017 Alan Somers
2316501Sasomers# All rights reserved.
3316501Sasomers#
4316501Sasomers# Redistribution and use in source and binary forms, with or without
5316501Sasomers# modification, are permitted provided that the following conditions
6316501Sasomers# are met:
7316501Sasomers# 1. Redistributions of source code must retain the above copyright
8316501Sasomers#    notice, this list of conditions and the following disclaimer.
9316501Sasomers# 2. Redistributions in binary form must reproduce the above copyright
10316501Sasomers#    notice, this list of conditions and the following disclaimer in the
11316501Sasomers#    documentation and/or other materials provided with the distribution.
12316501Sasomers#
13316501Sasomers# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
14316501Sasomers# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
15316501Sasomers# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16316501Sasomers# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
17316501Sasomers# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18316501Sasomers# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19316501Sasomers# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20316501Sasomers# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21316501Sasomers# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22316501Sasomers# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23316501Sasomers# POSSIBILITY OF SUCH DAMAGE.
24316501Sasomers#
25316501Sasomers# $FreeBSD: stable/10/usr.bin/pr/tests/basic2_test.sh 316501 2017-04-04 20:03:57Z asomers $
26316501Sasomers
27316501Sasomersatf_test_case across
28316501Sasomersacross_head() {
29316501Sasomers        atf_set "descr" "Format columns in round-robin order with pr -a"
30316501Sasomers}
31316501Sasomersacross_body() {
32316501Sasomers	atf_check -s exit:0 -o file:$(atf_get_srcdir)/across.out \
33316501Sasomers		-x "pr -t -a -2 $(atf_get_srcdir)/other.in"
34316501Sasomers}
35316501Sasomers
36316501Sasomersatf_test_case merge
37316501Sasomersmerge_head() {
38316501Sasomers        atf_set "descr" "Merge two files with pr -m"
39316501Sasomers}
40316501Sasomersmerge_body() {
41316501Sasomers	atf_check -s ignore -o file:$(atf_get_srcdir)/merge.out \
42316501Sasomers		pr -t -m $(atf_get_srcdir)/d_basic.in $(atf_get_srcdir)/other.in
43316501Sasomers}
44316501Sasomers
45316501Sasomersatf_test_case threecol
46316501Sasomersthreecol_head() {
47316501Sasomers        atf_set "descr" "Format a file with three columns"
48316501Sasomers}
49316501Sasomersthreecol_body() {
50316501Sasomers	atf_check -s ignore -o file:$(atf_get_srcdir)/threecol.out \
51316501Sasomers		pr -t -3 $(atf_get_srcdir)/other.in
52316501Sasomers}
53316501Sasomers
54316501Sasomersatf_init_test_cases()
55316501Sasomers{
56316501Sasomers        atf_add_test_case across
57316501Sasomers        atf_add_test_case merge
58316501Sasomers        atf_add_test_case threecol
59316501Sasomers}
60