From e6a4e87f69cdb8c76b24f136c945694db69f9b50 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 18 Dec 2022 16:28:30 -0700 Subject: [PATCH] update gitattributes and move test data into subdir --- .gitattributes | 4 ++-- build.zig | 2 +- lib/std/compress/gzip.zig | 4 ++-- lib/std/compress/{ => testdata}/rfc1951.txt | 0 .../compress/{ => testdata}/rfc1951.txt.fixed.z.9 | Bin lib/std/compress/{ => testdata}/rfc1951.txt.z.0 | Bin lib/std/compress/{ => testdata}/rfc1951.txt.z.9 | Bin lib/std/compress/{ => testdata}/rfc1952.txt | 0 lib/std/compress/{ => testdata}/rfc1952.txt.gz | Bin lib/std/compress/zlib.zig | 8 ++++---- 10 files changed, 9 insertions(+), 9 deletions(-) rename lib/std/compress/{ => testdata}/rfc1951.txt (100%) rename lib/std/compress/{ => testdata}/rfc1951.txt.fixed.z.9 (100%) rename lib/std/compress/{ => testdata}/rfc1951.txt.z.0 (100%) rename lib/std/compress/{ => testdata}/rfc1951.txt.z.9 (100%) rename lib/std/compress/{ => testdata}/rfc1952.txt (100%) rename lib/std/compress/{ => testdata}/rfc1952.txt.gz (100%) diff --git a/.gitattributes b/.gitattributes index 2983afbfc3..581789817c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,9 @@ *.zig text eol=lf *.txt text eol=lf langref.html.in text eol=lf -deps/SoftFloat-3e/*.txt text eol=crlf +lib/std/compress/testdata/** binary +lib/std/compress/deflate/testdata/** binary -deps/** linguist-vendored lib/include/** linguist-vendored lib/libc/** linguist-vendored lib/libcxx/** linguist-vendored diff --git a/build.zig b/build.zig index f2a7e48dc7..edcdfabfe0 100644 --- a/build.zig +++ b/build.zig @@ -106,7 +106,7 @@ pub fn build(b: *Builder) !void { .install_dir = .lib, .install_subdir = "zig", .exclude_extensions = &[_][]const u8{ - // exclude files from lib/std/compress/ + // exclude files from lib/std/compress/testdata ".gz", ".z.0", ".z.9", diff --git a/lib/std/compress/gzip.zig b/lib/std/compress/gzip.zig index c3b2335a1a..d7a2cb0094 100644 --- a/lib/std/compress/gzip.zig +++ b/lib/std/compress/gzip.zig @@ -172,8 +172,8 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void { // SHA256=164ef0897b4cbec63abf1b57f069f3599bd0fb7c72c2a4dee21bd7e03ec9af67 test "compressed data" { try testReader( - @embedFile("rfc1952.txt.gz"), - @embedFile("rfc1952.txt"), + @embedFile("testdata/rfc1952.txt.gz"), + @embedFile("testdata/rfc1952.txt"), ); } diff --git a/lib/std/compress/rfc1951.txt b/lib/std/compress/testdata/rfc1951.txt similarity index 100% rename from lib/std/compress/rfc1951.txt rename to lib/std/compress/testdata/rfc1951.txt diff --git a/lib/std/compress/rfc1951.txt.fixed.z.9 b/lib/std/compress/testdata/rfc1951.txt.fixed.z.9 similarity index 100% rename from lib/std/compress/rfc1951.txt.fixed.z.9 rename to lib/std/compress/testdata/rfc1951.txt.fixed.z.9 diff --git a/lib/std/compress/rfc1951.txt.z.0 b/lib/std/compress/testdata/rfc1951.txt.z.0 similarity index 100% rename from lib/std/compress/rfc1951.txt.z.0 rename to lib/std/compress/testdata/rfc1951.txt.z.0 diff --git a/lib/std/compress/rfc1951.txt.z.9 b/lib/std/compress/testdata/rfc1951.txt.z.9 similarity index 100% rename from lib/std/compress/rfc1951.txt.z.9 rename to lib/std/compress/testdata/rfc1951.txt.z.9 diff --git a/lib/std/compress/rfc1952.txt b/lib/std/compress/testdata/rfc1952.txt similarity index 100% rename from lib/std/compress/rfc1952.txt rename to lib/std/compress/testdata/rfc1952.txt diff --git a/lib/std/compress/rfc1952.txt.gz b/lib/std/compress/testdata/rfc1952.txt.gz similarity index 100% rename from lib/std/compress/rfc1952.txt.gz rename to lib/std/compress/testdata/rfc1952.txt.gz diff --git a/lib/std/compress/zlib.zig b/lib/std/compress/zlib.zig index 500bb0bb5b..0fc96a5aa9 100644 --- a/lib/std/compress/zlib.zig +++ b/lib/std/compress/zlib.zig @@ -107,21 +107,21 @@ fn testReader(data: []const u8, expected: []const u8) !void { // https://tools.ietf.org/rfc/rfc1951.txt length=36944 bytes // SHA256=5ebf4b5b7fe1c3a0c0ab9aa3ac8c0f3853a7dc484905e76e03b0b0f301350009 test "compressed data" { - const rfc1951_txt = @embedFile("rfc1951.txt"); + const rfc1951_txt = @embedFile("testdata/rfc1951.txt"); // Compressed with compression level = 0 try testReader( - @embedFile("rfc1951.txt.z.0"), + @embedFile("testdata/rfc1951.txt.z.0"), rfc1951_txt, ); // Compressed with compression level = 9 try testReader( - @embedFile("rfc1951.txt.z.9"), + @embedFile("testdata/rfc1951.txt.z.9"), rfc1951_txt, ); // Compressed with compression level = 9 and fixed Huffman codes try testReader( - @embedFile("rfc1951.txt.fixed.z.9"), + @embedFile("testdata/rfc1951.txt.fixed.z.9"), rfc1951_txt, ); }