authorgravatar for igor.anic@gmail.comIgor Anić <igor.anic@gmail.com> 2024-02-15 00:35:08+01:00
committergravatar for igor.anic@gmail.comIgor Anić <igor.anic@gmail.com> 2024-02-15 00:35:08+01:00
log99cb201438e9458547082b35e1dd7c7c46c8c1bd
treef2835a573abdc7da70284e878299145bc00b61a8
parentfd9db4962c3b06630c6b482e027a8babee9f12cb

skip failing wasm tests


2 files changed, 14 insertions(+), 2 deletions(-)

lib/std/compress/flate.zig+5
......@@ -77,6 +77,7 @@ const std = @import("std");
7777const testing = std.testing;
7878const fixedBufferStream = std.io.fixedBufferStream;
7979const print = std.debug.print;
80const builtin = @import("builtin");
8081
8182test "flate" {
8283 _ = @import("flate/deflate.zig");
......@@ -84,6 +85,8 @@ test "flate" {
8485}
8586
8687test "flate compress/decompress" {
88 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
89
8790 var cmp_buf: [64 * 1024]u8 = undefined; // compressed data buffer
8891 var dcm_buf: [64 * 1024]u8 = undefined; // decompressed data buffer
8992
......@@ -351,6 +354,8 @@ test "flate gzip header" {
351354}
352355
353356test "flate public interface" {
357 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
358
354359 const plain_data = [_]u8{ 'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', 0x0a };
355360
356361 // deflate final stored block, header + plain (stored) data
lib/std/compress/flate/deflate.zig+9-2
......@@ -528,7 +528,11 @@ fn SimpleCompressor(
528528 };
529529}
530530
531const builtin = @import("builtin");
532
531533test "flate.Deflate tokenization" {
534 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
535
532536 const L = Token.initLiteral;
533537 const M = Token.initMatch;
534538
......@@ -551,6 +555,7 @@ test "flate.Deflate tokenization" {
551555
552556 for (cases) |c| {
553557 inline for (Container.list) |container| { // for each wrapping
558
554559 var cw = io.countingWriter(io.null_writer);
555560 const cww = cw.writer();
556561 var df = try Deflate(container, @TypeOf(cww), TestTokenWriter).init(cww, .{});
......@@ -572,9 +577,9 @@ test "flate.Deflate tokenization" {
572577// Tests that tokens writen are equal to expected token list.
573578const TestTokenWriter = struct {
574579 const Self = @This();
575 //expected: []const Token,
580
576581 pos: usize = 0,
577 actual: [1024]Token = undefined,
582 actual: [128]Token = undefined,
578583
579584 pub fn init(_: anytype) Self {
580585 return .{};
......@@ -603,6 +608,8 @@ const TestTokenWriter = struct {
603608};
604609
605610test "flate deflate file tokenization" {
611 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
612
606613 const levels = [_]Level{ .level_4, .level_5, .level_6, .level_7, .level_8, .level_9 };
607614 const cases = [_]struct {
608615 data: []const u8, // uncompressed content