diff --git a/util/src/test/java/dev/openrs2/util/io/SkipOutputStreamTest.kt b/util/src/test/java/dev/openrs2/util/io/SkipOutputStreamTest.kt index 5ee2f07a09..7e359ba6bf 100644 --- a/util/src/test/java/dev/openrs2/util/io/SkipOutputStreamTest.kt +++ b/util/src/test/java/dev/openrs2/util/io/SkipOutputStreamTest.kt @@ -2,7 +2,10 @@ package dev.openrs2.util.io import org.junit.jupiter.api.Assertions.assertArrayEquals import java.io.ByteArrayOutputStream +import java.io.FilterOutputStream +import java.io.OutputStream import kotlin.test.Test +import kotlin.test.assertTrue object SkipOutputStreamTest { @Test @@ -48,4 +51,21 @@ object SkipOutputStreamTest { } } } + + @Test + fun testFlush() { + val out = object : FilterOutputStream(OutputStream.nullOutputStream()) { + var flushed = false + + override fun flush() { + flushed = true + } + } + + SkipOutputStream(out, 0).use { skip -> + skip.flush() + } + + assertTrue(out.flushed) + } }