aboutsummaryrefslogtreecommitdiff
path: root/src/test/kotlin/com/replaymod/gradle/remap/pattern/TestChangeMerging.kt
blob: e8b86d2e506e0d2684772a5a248f9b46544fda63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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()
    }
}