Skip to content

Commit

Permalink
Removes that test support with comma-separated strings
Browse files Browse the repository at this point in the history
  • Loading branch information
BraisGabin committed Jun 14, 2022
1 parent 1a3057f commit 71ca68e
Showing 1 changed file with 3 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ class ForbiddenMethodCallSpec(val env: KotlinCoreEnvironment) {
System.out.println("hello")
}
"""
val findings =
ForbiddenMethodCall(TestConfig(mapOf(METHODS to " "))).compileAndLintWithContext(
env,
code
)
val findings = ForbiddenMethodCall(
TestConfig(mapOf(METHODS to listOf(" ")))
).compileAndLintWithContext(env, code)
assertThat(findings).isEmpty()
}

Expand Down Expand Up @@ -114,22 +112,6 @@ class ForbiddenMethodCallSpec(val env: KotlinCoreEnvironment) {
assertThat(findings).hasTextLocations(48 to 64, 76 to 80)
}

@Test
fun `should report multiple different methods config with sting`() {
val code = """
import java.lang.System
fun main() {
System.out.println("hello")
System.gc()
}
"""
val findings = ForbiddenMethodCall(
TestConfig(mapOf(METHODS to "java.io.PrintStream.println, java.lang.System.gc"))
).compileAndLintWithContext(env, code)
assertThat(findings).hasSize(2)
assertThat(findings).hasTextLocations(48 to 64, 76 to 80)
}

@Test
fun `should report equals operator`() {
val code = """
Expand Down

0 comments on commit 71ca68e

Please sign in to comment.