aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt
diff options
context:
space:
mode:
authorJonas Herzig <jonas@spark-squared.com>2021-11-12 11:05:14 +0100
committerJonas Herzig <jonas@spark-squared.com>2021-11-12 15:23:25 +0100
commit9a048424d3273152b02aafff690b8a420eae17e4 (patch)
tree257c25bf40aefc9d18f308d77475824e28441912 /src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt
parent117d1cf035edc83017e344a6142c40cd72420642 (diff)
downloadRemap-9a048424d3273152b02aafff690b8a420eae17e4.tar.gz
Remap-9a048424d3273152b02aafff690b8a420eae17e4.tar.bz2
Remap-9a048424d3273152b02aafff690b8a420eae17e4.zip
Fix inject method in constant being duplicated if remapped twice
Diffstat (limited to 'src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt')
-rw-r--r--src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt b/src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt
index fd4c1cb..b473dbe 100644
--- a/src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt
+++ b/src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt
@@ -139,6 +139,29 @@ class TestMixinInjections {
}
@Test
+ fun `remaps method in constant`() {
+ TestData.remap("""
+ @org.spongepowered.asm.mixin.Mixin(a.pkg.A.class)
+ class MixinA {
+ private static final String TARGET = "aMethod";
+ @org.spongepowered.asm.mixin.injection.Inject(method = TARGET)
+ private void test1() {}
+ @org.spongepowered.asm.mixin.injection.Inject(method = TARGET)
+ private void test2() {}
+ }
+ """.trimIndent()) shouldBe """
+ @org.spongepowered.asm.mixin.Mixin(b.pkg.B.class)
+ class MixinA {
+ private static final String TARGET = "bMethod";
+ @org.spongepowered.asm.mixin.injection.Inject(method = TARGET)
+ private void test1() {}
+ @org.spongepowered.asm.mixin.injection.Inject(method = TARGET)
+ private void test2() {}
+ }
+ """.trimIndent()
+ }
+
+ @Test
fun `remaps @At target`() {
TestData.remap("""
import org.spongepowered.asm.mixin.injection.At;