Skip to content

Commit

Permalink
Update dependencies, fix a few tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchallen committed Jun 24, 2021
1 parent 06beb7f commit 16c5813
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
kotlin("jvm") version "1.5.10" apply false
kotlin("kapt") version "1.5.10" apply false
kotlin("jvm") version "1.5.20" apply false
kotlin("kapt") version "1.5.20" apply false
id("org.jmailen.kotlinter") version "3.4.5" apply false
id("com.github.ben-manes.versions") version "0.39.0"
id("io.gitlab.arturbosch.detekt") version "1.17.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2021.6.5
version=2021.6.6
4 changes: 2 additions & 2 deletions core/src/main/kotlin/Features.kt
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ val lessonMap = mapOf(
FeatureName.STREAM to 39
)

fun generateComparator() = Comparator<FeatureValue>{ first, second ->
fun generateComparator() = Comparator<FeatureValue> { first, second ->
val firstFeatures = first.features.featureMap.filterValues { it > 0 }
val secondFeatures = second.features.featureMap.filterValues { it > 0 }
var firstLevel = 0
Expand All @@ -1012,4 +1012,4 @@ fun generateComparator() = Comparator<FeatureValue>{ first, second ->
firstLevel < secondLevel -> -1
else -> 0
}
}
}
7 changes: 4 additions & 3 deletions core/src/test/kotlin/TestFeatures.kt
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,8 @@ if (i < 15) {
}
""".trim()
).features().also {
it.lookup("").features.skeleton.trim() shouldBe "if { for { do { if else } while } while } else { do while if else }"
it.lookup("").features.skeleton.trim() shouldBe
"if { for { do { if else } while } while } else { do while if else }"
}
}
"should correctly count break and continue in snippets" {
Expand Down Expand Up @@ -739,7 +740,7 @@ List<String> list = new ArrayList<>();
it.lookup(".").features.featureMap[FeatureName.TYPE_PARAMETERS] shouldBe 1
}
}
"f: should correctly compare two snippets" {
"should correctly compare two snippets" {
val first = Source.fromSnippet(
"""
int i = 0;
Expand All @@ -758,7 +759,7 @@ for (int i = 0; i < 10; i++) { }
val comparator = generateComparator()
comparator.compare(first, second) shouldBe 1
}
"f: should correctly compare two files" {
"should correctly compare two files" {
val first = Source(
mapOf(
"Test.java" to """
Expand Down
1 change: 1 addition & 0 deletions core/src/test/kotlin/TestJavaMutater.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import io.kotest.matchers.string.shouldMatch
import io.kotest.matchers.string.shouldNotContain
import kotlin.random.Random

@Suppress("LargeClass")
class TestJavaMutater : StringSpec({
"it should find boolean literals to mutate" {
Source.fromJava(
Expand Down
4 changes: 2 additions & 2 deletions core/src/test/kotlin/sandbox/TestOutputCapture.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ for (int i = 0; i < 32; i++) {
}
} else {
async {
for (j in 1..512) {
repeat(512) {
println("Bad")
System.err.println("Bad")
delay(1L)
Expand All @@ -108,7 +108,7 @@ for (int i = 0; i < 32; i++) {
System.setErr(originalStderr)

val unrelatedOutput = combinedOutputStream.toString()
unrelatedOutput.lines().filter { it == "Bad" }.size shouldBe 4 * 2 * 512
unrelatedOutput.lines().filter { it == "Bad" }.size shouldBe (4 * 2 * 512)
}
"should redirect output to trusted task properly" {
val compiledSource = Source.fromSnippet(
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=2021.6.5
version=2021.6.6

0 comments on commit 16c5813

Please sign in to comment.