This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-compress.git
The following commit(s) were added to refs/heads/master by this push: new 13623593 Fix broken tests. 13623593 is described below commit 13623593b92239f66b075f308045dc89ab8ce94a Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Thu May 5 15:38:32 2022 -0400 Fix broken tests. --- .../compress/compressors/lz77support/LZ77CompressorTest.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/apache/commons/compress/compressors/lz77support/LZ77CompressorTest.java b/src/test/java/org/apache/commons/compress/compressors/lz77support/LZ77CompressorTest.java index 6cd6b102..3bba056d 100644 --- a/src/test/java/org/apache/commons/compress/compressors/lz77support/LZ77CompressorTest.java +++ b/src/test/java/org/apache/commons/compress/compressors/lz77support/LZ77CompressorTest.java @@ -28,6 +28,7 @@ import org.junit.jupiter.api.Test; import static java.nio.charset.StandardCharsets.*; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThrows; public class LZ77CompressorTest { @@ -270,18 +271,16 @@ public class LZ77CompressorTest { @Test public void cantPrefillTwice() { - final LZ77Compressor c = new LZ77Compressor(newParameters(128), block -> { - }); + final LZ77Compressor c = new LZ77Compressor(newParameters(128), block -> {}); c.prefill(Arrays.copyOfRange(BLA, 0, 2)); - c.prefill(Arrays.copyOfRange(BLA, 2, 4)); + assertThrows(IllegalStateException.class, () -> c.prefill(Arrays.copyOfRange(BLA, 2, 4))); } @Test public void cantPrefillAfterCompress() throws IOException { - final LZ77Compressor c = new LZ77Compressor(newParameters(128), block -> { - }); + final LZ77Compressor c = new LZ77Compressor(newParameters(128), block -> {}); c.compress(Arrays.copyOfRange(BLA, 0, 2)); - c.prefill(Arrays.copyOfRange(BLA, 2, 4)); + assertThrows(IllegalStateException.class, () -> c.prefill(Arrays.copyOfRange(BLA, 2, 4))); } private static final void assertSize(final int expectedSize, final List<LZ77Compressor.Block> blocks) {