Skip to content
Permalink
Browse files
Fix broken tests.
  • Loading branch information
garydgregory committed May 5, 2022
1 parent 1fb9ef9 commit 13623593b92239f66b075f308045dc89ab8ce94a
Showing 1 changed file with 5 additions and 6 deletions.
@@ -28,6 +28,7 @@
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 void blaExampleWithPrefillBiggerThanWindowSize() throws IOException {

@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) {

0 comments on commit 1362359

Please sign in to comment.