xref: /freebsd/contrib/libarchive/unzip/test/test_singlefile.c (revision b64c5a0ace59af62eff52bfe110a521dc73c937b)
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 /* Ensure single-file zips work */
10 DEFINE_TEST(test_singlefile)
11 {
12 	const char *reffile = "test_singlefile.zip";
13 	int r;
14 
15 	extract_reference_file(reffile);
16 	r = systemf("%s %s >test.out 2>test.err", testprog, reffile);
17 	assertEqualInt(0, r);
18 	assertNonEmptyFile("test.out");
19 	assertEmptyFile("test.err");
20 
21 	assertTextFileContents("hello\n", "file.txt");
22 }
23