Skip to content

Commit

Permalink
Create TestGenericJavaCode
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Jan 5, 2024
1 parent bbecce1 commit 79e6c3b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.replaymod.gradle.remap.generic

import com.replaymod.gradle.remap.util.TestData
import io.kotest.matchers.shouldBe
import org.junit.jupiter.api.Test

class TestGenericJavaCode {
@Test
fun `remaps methods that have synthetic bridges that change the return type`() {
TestData.remap("""
@org.spongepowered.asm.mixin.Mixin(a.pkg.A.class)
abstract class MixinA {
private void test() {
final a.pkg.A value = null;
value.aGeneratedSynthetic();
}
}
""".trimIndent()) shouldBe """
@org.spongepowered.asm.mixin.Mixin(b.pkg.B.class)
abstract class MixinA {
private void test() {
final b.pkg.B value = null;
value.bGeneratedSynthetic();
}
}
""".trimIndent()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,4 @@ class TestMixinShadow {
}
""".trimIndent()
}

@Test
fun `remaps methods that have synthetic bridges that change the return type`() {
TestData.remap("""
@org.spongepowered.asm.mixin.Mixin(a.pkg.A.class)
abstract class MixinA {
private void test() {
final a.pkg.A value = null;
value.aGeneratedSynthetic();
}
}
""".trimIndent()) shouldBe """
@org.spongepowered.asm.mixin.Mixin(b.pkg.B.class)
abstract class MixinA {
private void test() {
final b.pkg.B value = null;
value.bGeneratedSynthetic();
}
}
""".trimIndent()
}
}

0 comments on commit 79e6c3b

Please sign in to comment.