diff --git a/src/test/kotlin/net/revanced/patcher/PatcherTest.kt b/src/test/kotlin/net/revanced/patcher/PatcherTest.kt index 9f09336..270a9fb 100644 --- a/src/test/kotlin/net/revanced/patcher/PatcherTest.kt +++ b/src/test/kotlin/net/revanced/patcher/PatcherTest.kt @@ -5,10 +5,12 @@ import net.revanced.patcher.patch.PatchResultSuccess import net.revanced.patcher.signature.Signature import net.revanced.patcher.util.ExtraTypes import net.revanced.patcher.writer.ASMWriter.setAt -import org.junit.jupiter.api.Test import org.objectweb.asm.Opcodes.* import org.objectweb.asm.Type import org.objectweb.asm.tree.LdcInsnNode +import java.io.ByteArrayOutputStream +import kotlin.test.Test +import kotlin.test.assertTrue internal class PatcherTest { private val testSigs: Array = arrayOf( @@ -65,5 +67,13 @@ internal class PatcherTest { throw Exception("Patch $s failed", r.exceptionOrNull()!!) } } + + val out = ByteArrayOutputStream() + patcher.saveTo(out) + assertTrue( + // 8 is a random value, it's just weird if it's any lower than that + out.size() > 8, + "Output must be at least 8 bytes" + ) } } \ No newline at end of file