xref: /freebsd/contrib/libarchive/unzip/test/test_Z1.c (revision 3750ccefb8629a08890bfbae894dd6bc6a7483b4)
1 /*
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2023 Adrian Vovk
5  * All rights reserved.
6  */
7 #include "test.h"
8 
9 /* Test -Z1 arg - List filenames */
10 DEFINE_TEST(test_Z1)
11 {
12 	const char *reffile = "test_basic.zip";
13 	int r;
14 
15 	extract_reference_file(reffile);
16 	r = systemf("%s -Z1 %s >test.out 2>test.err", testprog, reffile);
17 	assertEqualInt(0, r);
18 	assertNonEmptyFile("test.out");
19 	assertTextFileContents("test_basic/\ntest_basic/a\ntest_basic/b\ntest_basic/c\ntest_basic/CAPS\n", "test.out");
20 	assertEmptyFile("test.err");
21 }
22