mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-03 14:14:26 +02:00
test: add test for multiple classes in jar
This commit is contained in:
parent
5f12bab5df
commit
6b1cec4a43
@ -23,4 +23,7 @@ dependencies {
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
testLogging {
|
||||
events("PASSED", "SKIPPED", "FAILED")
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,8 @@ import java.io.PrintStream
|
||||
import kotlin.test.Test
|
||||
|
||||
internal class PatcherTest {
|
||||
private val testSigs: Array<Signature> = arrayOf(
|
||||
companion object {
|
||||
val testSigs: Array<Signature> = arrayOf(
|
||||
// Java:
|
||||
// public static void main(String[] args) {
|
||||
// System.out.println("Hello, world!");
|
||||
@ -37,6 +38,7 @@ internal class PatcherTest {
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testPatcher() {
|
||||
@ -127,7 +129,7 @@ internal class PatcherTest {
|
||||
|
||||
// TODO Doesn't work, needs to be fixed.
|
||||
//@Test
|
||||
//fun noChanges() {
|
||||
//fun `test patcher with no changes`() {
|
||||
// val testData = PatcherTest::class.java.getResourceAsStream("/test1.jar")!!
|
||||
// val available = testData.available()
|
||||
// val patcher = Patcher(testData, testSigs)
|
||||
|
12
src/test/kotlin/net/revanced/patcher/ReaderTest.kt
Normal file
12
src/test/kotlin/net/revanced/patcher/ReaderTest.kt
Normal file
@ -0,0 +1,12 @@
|
||||
package net.revanced.patcher
|
||||
|
||||
import kotlin.test.Test
|
||||
|
||||
internal class ReaderTest {
|
||||
@Test
|
||||
fun `read jar containing multiple classes`() {
|
||||
val testData = PatcherTest::class.java.getResourceAsStream("/test2.jar")!!
|
||||
Patcher(testData, PatcherTest.testSigs) // reusing test sigs from PatcherTest
|
||||
testData.close()
|
||||
}
|
||||
}
|
BIN
src/test/resources/test2.jar
Normal file
BIN
src/test/resources/test2.jar
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user