Lines Matching +full:foo +full:- +full:bar

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2003-2007 Tim Kientzle
16 * any earlier versions. The -q/--fast-read option will in DEFINE_TEST()
17 * stop early, so we can verify -q/--fast-read by seeing in DEFINE_TEST()
19 * extracted. This also exercises -r mode, since that's in DEFINE_TEST()
23 assertMakeFile("foo", 0644, "foo1"); in DEFINE_TEST()
25 assertEqualInt(0, systemf("%s -cf archive.tar foo", testprog)); in DEFINE_TEST()
27 assertMakeFile("foo", 0644, "foo2"); in DEFINE_TEST()
29 assertEqualInt(0, systemf("%s -rf archive.tar foo", testprog)); in DEFINE_TEST()
31 assertMakeFile("bar", 0644, "bar1"); in DEFINE_TEST()
33 assertEqualInt(0, systemf("%s -rf archive.tar bar", testprog)); in DEFINE_TEST()
35 assertMakeFile("foo", 0644, "foo3"); in DEFINE_TEST()
37 assertEqualInt(0, systemf("%s -rf archive.tar foo", testprog)); in DEFINE_TEST()
39 assertMakeFile("bar", 0644, "bar2"); in DEFINE_TEST()
41 assertEqualInt(0, systemf("%s -rf archive.tar bar", testprog)); in DEFINE_TEST()
45 * combinations of -q. in DEFINE_TEST()
48 /* Test 1: -q foo should only extract the first foo. */ in DEFINE_TEST()
51 r = systemf("%s -xf ../archive.tar -q foo >test.out 2>test.err", in DEFINE_TEST()
53 failure("Fatal error trying to use -q option"); in DEFINE_TEST()
57 assertFileContents("foo1", 4, "foo"); in DEFINE_TEST()
62 /* Test 2: -q foo bar should extract up to the first bar. */ in DEFINE_TEST()
66 systemf("%s -xf ../archive.tar -q foo bar >test.out 2>test.err", testprog)); in DEFINE_TEST()
67 assertFileContents("foo2", 4, "foo"); in DEFINE_TEST()
68 assertFileContents("bar1", 4, "bar"); in DEFINE_TEST()
73 /* Test 3: Same as test 2, but use --fast-read spelling. */ in DEFINE_TEST()
77 systemf("%s -xf ../archive.tar --fast-read foo bar >test.out 2>test.err", testprog)); in DEFINE_TEST()
78 assertFileContents("foo2", 4, "foo"); in DEFINE_TEST()
79 assertFileContents("bar1", 4, "bar"); in DEFINE_TEST()
84 /* Test 4: Without -q, should extract everything. */ in DEFINE_TEST()
88 systemf("%s -xf ../archive.tar foo bar >test.out 2>test.err", testprog)); in DEFINE_TEST()
89 assertFileContents("foo3", 4, "foo"); in DEFINE_TEST()
90 assertFileContents("bar2", 4, "bar"); in DEFINE_TEST()