Explain how the test_option_q test works.
This commit is contained in:
parent
3873424684
commit
ba1a633912
@ -29,6 +29,16 @@ DEFINE_TEST(test_option_q)
|
||||
{
|
||||
int fd;
|
||||
|
||||
/*
|
||||
* Create an archive with several different versions of the
|
||||
* same files. By default, the last version will overwrite
|
||||
* any earlier versions. The -q/--fast-read option will
|
||||
* stop early, so we can verify -q/--fast-read by seeing
|
||||
* which version of each file actually ended up being
|
||||
* extracted. This also exercises -r mode, since that's
|
||||
* what we use to build up the test archive.
|
||||
*/
|
||||
|
||||
fd = open("foo", O_CREAT | O_WRONLY, 0644);
|
||||
assert(fd >= 0);
|
||||
assertEqualInt(4, write(fd, "foo1", 4));
|
||||
@ -64,6 +74,11 @@ DEFINE_TEST(test_option_q)
|
||||
|
||||
assertEqualInt(0, systemf("%s -rf archive.tar bar", testprog));
|
||||
|
||||
/*
|
||||
* Now, try extracting from the test archive with various
|
||||
* combinations of -q.
|
||||
*/
|
||||
|
||||
/* Test 1: -q foo should only extract the first foo. */
|
||||
assertEqualInt(0, mkdir("test1", 0755));
|
||||
assertEqualInt(0, chdir("test1"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user