aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin/com/replaymod/gradle/remap/pattern/TestChangeMerging.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/kotlin/com/replaymod/gradle/remap/pattern/TestChangeMerging.kt')
-rw-r--r--src/test/kotlin/com/replaymod/gradle/remap/pattern/TestChangeMerging.kt36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/test/kotlin/com/replaymod/gradle/remap/pattern/TestChangeMerging.kt b/src/test/kotlin/com/replaymod/gradle/remap/pattern/TestChangeMerging.kt
new file mode 100644
index 0000000..e8b86d2
--- /dev/null
+++ b/src/test/kotlin/com/replaymod/gradle/remap/pattern/TestChangeMerging.kt
@@ -0,0 +1,36 @@
+package com.replaymod.gradle.remap.pattern
+
+import com.replaymod.gradle.remap.util.TestData
+import io.kotest.matchers.collections.shouldHaveSize
+import io.kotest.matchers.shouldBe
+import io.kotest.matchers.string.shouldContain
+import org.junit.jupiter.api.Test
+
+class TestChangeMerging {
+ @Test
+ fun `should work when mixed with remapping`() {
+ TestData.remap("""
+ class Test {
+ private void test() {
+ a.pkg.A.create().aMethod();
+ }
+ }
+ """.trimIndent(), """
+ @remap.Pattern
+ private void addWrapping(a.pkg.A a) {
+ a.aMethod();
+ }
+ """.trimIndent(), """
+ @remap.Pattern
+ private void addWrapping(a.pkg.A a) {
+ (((a.bMethod())));
+ }
+ """.trimIndent()) shouldBe """
+ class Test {
+ private void test() {
+ (((b.pkg.B.create().bMethod())));
+ }
+ }
+ """.trimIndent()
+ }
+} \ No newline at end of file