xref: /freebsd/contrib/libarchive/unzip/test/test_j.c (revision 5036d9652a5701d00e9e40ea942c278e9f77d33d)
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 j arg - don't make directories */
10 DEFINE_TEST(test_j)
11 {
12 	const char *reffile = "test_basic.zip";
13 	int r;
14 
15 	extract_reference_file(reffile);
16 	r = systemf("%s -j %s >test.out 2>test.err", testprog, reffile);
17 	assertEqualInt(0, r);
18 	assertNonEmptyFile("test.out");
19 	assertEmptyFile("test.err");
20 
21 	assertTextFileContents("contents a\n", "a");
22 	assertTextFileContents("contents b\n", "b");
23 	assertTextFileContents("contents c\n", "c");
24 	assertTextFileContents("contents CAPS\n", "CAPS");
25 }
26