mirror of
https://github.com/ReVanced/revanced-patcher.git
synced 2024-11-10 01:02:22 +01:00
Add saveTo test
This commit is contained in:
parent
8c56d15823
commit
57d5751b2c
1 changed files with 11 additions and 1 deletions
|
@ -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<Signature> = 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"
|
||||
)
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue