]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
When verifying the files recognized by tar, ignore end-of-line variations.
authorTim Kientzle <kientzle@gmail.com>
Sun, 17 Jan 2010 22:55:10 +0000 (17:55 -0500)
committerTim Kientzle <kientzle@gmail.com>
Sun, 17 Jan 2010 22:55:10 +0000 (17:55 -0500)
SVN-Revision: 1829

tar/test/test_patterns.c

index 2ba4bd3e9f23b36b4431854ea17f6d28f4f1887a..fee98be9b27070b002228d025a70633e4bdf2974 100644 (file)
@@ -33,7 +33,12 @@ DEFINE_TEST(test_patterns)
        const char *reffile2 = "test_patterns_2.tar";
        const char *reffile3 = "test_patterns_3.tar";
        const char *reffile4 = "test_patterns_4.tar";
-       const char *p;
+
+       const char *tar2aExpected[] = {
+               "/tmp/foo/bar/",
+               "/tmp/foo/bar/baz",
+               NULL
+       };
 
        /*
         * Test basic command-line pattern handling.
@@ -62,12 +67,7 @@ DEFINE_TEST(test_patterns)
        r = systemf("%s tf %s /tmp/foo/bar > tar2a.out 2> tar2a.err",
            testprog, reffile2);
        assertEqualInt(r, 0);
-#if !defined(_WIN32) || defined(__CYGWIN__)
-       p = "/tmp/foo/bar/\n/tmp/foo/bar/baz\n";
-#else
-       p = "/tmp/foo/bar/\r\n/tmp/foo/bar/baz\r\n";
-#endif
-       assertFileContents(p, strlen(p), "tar2a.out");
+       assertFileContainsLinesAnyOrder("tar2a.out", tar2aExpected);
        assertEmptyFile("tar2a.err");
 
        /*