Skip to content

Commit

Permalink
add another micro compression test
Browse files Browse the repository at this point in the history
  • Loading branch information
tayloraswift committed Apr 3, 2024
1 parent 739d899 commit 4553010
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Sources/LZ77Tests/Main.CompressionMicro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ extension Main.CompressionMicro:TestBattery
{
Self.roundtrip(bytes: [4, 5, 6], with: tests)
}
if let tests:TestGroup = tests / "InParts"
{
var deflator:Gzip.Deflator = .init(level: 13, exponent: 15)
deflator.push([1], last: false)
deflator.push([2], last: true)

var archive:[UInt8] = []
while let part:[UInt8] = deflator.pull()
{
archive += part
}

tests.do
{
tests.expect(try Gzip.extract(from: archive[...]) ..? [1, 2])
}
}
}

private static
Expand Down

0 comments on commit 4553010

Please sign in to comment.