mirror of
https://github.com/ziglang/zig.git
synced 2026-01-10 01:15:14 +00:00
Merge pull request #13999 from ziglang/gitattributes
Update gitattributes and re-enable std lib compression test on Windows
This commit is contained in:
commit
d1f61f2d68
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -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
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -31,6 +31,11 @@ if ((git rev-parse --is-shallow-repository) -eq "true") {
|
||||
git fetch --unshallow # `git describe` won't work on a shallow repo
|
||||
}
|
||||
|
||||
# Fix files that have their gitattributes changed
|
||||
git rm -rf lib
|
||||
git restore --staged lib
|
||||
git checkout lib
|
||||
|
||||
Write-Output "Building from source..."
|
||||
Remove-Item -Path 'build-release' -Recurse -Force -ErrorAction Ignore
|
||||
New-Item -Path 'build-release' -ItemType Directory
|
||||
|
||||
@ -848,11 +848,6 @@ test "writeBlockHuff" {
|
||||
// Tests huffman encoding against reference files to detect possible regressions.
|
||||
// If encoding/bit allocation changes you can regenerate these files
|
||||
|
||||
if (builtin.os.tag == .windows) {
|
||||
// https://github.com/ziglang/zig/issues/13892
|
||||
return error.SkipZigTest;
|
||||
}
|
||||
|
||||
try testBlockHuff(
|
||||
"huffman-null-max.input",
|
||||
"huffman-null-max.golden",
|
||||
|
||||
@ -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"),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user