mirror of
https://github.com/revanced/revanced-patcher.git
synced 2025-05-06 23:24: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 {
|
tasks.test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
|
testLogging {
|
||||||
|
events("PASSED", "SKIPPED", "FAILED")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,8 @@ import java.io.PrintStream
|
|||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
|
|
||||||
internal class PatcherTest {
|
internal class PatcherTest {
|
||||||
private val testSigs: Array<Signature> = arrayOf(
|
companion object {
|
||||||
|
val testSigs: Array<Signature> = arrayOf(
|
||||||
// Java:
|
// Java:
|
||||||
// public static void main(String[] args) {
|
// public static void main(String[] args) {
|
||||||
// System.out.println("Hello, world!");
|
// System.out.println("Hello, world!");
|
||||||
@ -37,6 +38,7 @@ internal class PatcherTest {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun testPatcher() {
|
fun testPatcher() {
|
||||||
@ -127,7 +129,7 @@ internal class PatcherTest {
|
|||||||
|
|
||||||
// TODO Doesn't work, needs to be fixed.
|
// TODO Doesn't work, needs to be fixed.
|
||||||
//@Test
|
//@Test
|
||||||
//fun noChanges() {
|
//fun `test patcher with no changes`() {
|
||||||
// val testData = PatcherTest::class.java.getResourceAsStream("/test1.jar")!!
|
// val testData = PatcherTest::class.java.getResourceAsStream("/test1.jar")!!
|
||||||
// val available = testData.available()
|
// val available = testData.available()
|
||||||
// val patcher = Patcher(testData, testSigs)
|
// 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