diff options
author | Jonas Herzig <jonas@spark-squared.com> | 2021-11-11 21:22:12 +0100 |
---|---|---|
committer | Jonas Herzig <jonas@spark-squared.com> | 2021-11-12 15:23:25 +0100 |
commit | 117d1cf035edc83017e344a6142c40cd72420642 (patch) | |
tree | 0be285499790af2ca286062170e5fb01ceffc7cb /src/test | |
parent | f1224518f86b0160149544dc8d56505a37a186e2 (diff) | |
download | Remap-117d1cf035edc83017e344a6142c40cd72420642.tar.gz Remap-117d1cf035edc83017e344a6142c40cd72420642.tar.bz2 Remap-117d1cf035edc83017e344a6142c40cd72420642.zip |
Fix @At target in constant being duplicated if remapped twice
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt | 27 |
1 files changed, 27 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 f01a832..fd4c1cb 100644 --- a/src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt +++ b/src/test/kotlin/com/replaymod/gradle/remap/mapper/TestMixinInjections.kt @@ -179,4 +179,31 @@ class TestMixinInjections { } """.trimIndent() } + + @Test + fun `remaps @At target in constant`() { + TestData.remap(""" + import org.spongepowered.asm.mixin.injection.At; + import org.spongepowered.asm.mixin.injection.Inject; + @org.spongepowered.asm.mixin.Mixin(a.pkg.A.class) + class MixinA { + private static final String TARGET = "La/pkg/A;aInterfaceMethod()V"; + @Inject(method = "aMethod", at = @At(target = TARGET)) + private void test1() {} + @Inject(method = "aMethod", at = @At(target = TARGET)) + private void test2() {} + } + """.trimIndent()) shouldBe """ + import org.spongepowered.asm.mixin.injection.At; + import org.spongepowered.asm.mixin.injection.Inject; + @org.spongepowered.asm.mixin.Mixin(b.pkg.B.class) + class MixinA { + private static final String TARGET = "Lb/pkg/B;bInterfaceMethod()V"; + @Inject(method = "bMethod", at = @At(target = TARGET)) + private void test1() {} + @Inject(method = "bMethod", at = @At(target = TARGET)) + private void test2() {} + } + """.trimIndent() + } }
\ No newline at end of file |