Skip to content

Commit

Permalink
bump jacoco tool version
Browse files Browse the repository at this point in the history
  • Loading branch information
codeniko committed Jun 19, 2020
1 parent b4b3fbb commit dc3d688
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 31 deletions.
33 changes: 5 additions & 28 deletions src/test/kotlin/com/nfeld/jsonpathkt/TokenTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -364,39 +364,16 @@ class TokenTest : DescribeSpec({
WildcardToken().toString() shouldBe "WildcardToken"
WildcardToken().hashCode() shouldBe "WildcardToken".hashCode()
WildcardToken().equals(WildcardToken()) shouldBe true
WildcardToken().equals(RootLevelArrayNode()) shouldBe false
WildcardToken().equals(ArrayAccessorToken(0)) shouldBe false
}
}

describe("DeepScanWildcardToken") {
it("should handle empty cases") {
WildcardToken().read(createArrayNode()).toString() shouldBe """[]"""
WildcardToken().read(createObjectNode()).toString() shouldBe """[]"""
}

it("should get values from objects and strip") {
val objectNode = readTree("""{ "some": "string", "int": 42, "object": { "key": "value" }, "array": [0, 1] }""")
WildcardToken().read(objectNode).toString() shouldBe """["string",42,{"key":"value"},[0,1]]"""
}

it("should return a RootLevelArrayNode if root list replaced with another list before modifying values") {
val arrayNode = readTree("""["string", 42, { "key": "value" }, [0, 1] ]""")
WildcardToken().read(arrayNode).toString() shouldBe """["string",42,{"key":"value"},[0,1]]"""
}

it("should drop scalars and move everything down on root RootLevelArrayNode") {
val arrayNode = readTree("""["string", 42, { "key": "value" }, [0, 1] ]""")
val res1 = WildcardToken().read(arrayNode)
(res1 is RootLevelArrayNode) shouldBe true
val res2 = WildcardToken().read(res1!!)
res2.toString() shouldBe """["value",0,1]"""
}

it("should override toString, hashCode, and equals") {
WildcardToken().toString() shouldBe "WildcardToken"
WildcardToken().hashCode() shouldBe "WildcardToken".hashCode()
WildcardToken().equals(WildcardToken()) shouldBe true
WildcardToken().equals(RootLevelArrayNode()) shouldBe false
DeepScanWildcardToken().toString() shouldBe "DeepScanWildcardToken"
DeepScanWildcardToken().hashCode() shouldBe "DeepScanWildcardToken".hashCode()
DeepScanWildcardToken().equals(DeepScanWildcardToken()) shouldBe true
DeepScanWildcardToken().equals(ArrayAccessorToken(0)) shouldBe false
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions tests_codecov.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

ext {
shouldBenchmark = false
readmeFormat = false // pass -DreadmeFormat to format benchmark results to update readme
kotestVersion = '4.1.0.RC2'
}
Expand Down Expand Up @@ -110,7 +109,7 @@ test {
}

jacoco {
toolVersion = "0.8.3"
toolVersion = "0.8.5"
reportsDir = file("$buildDir/reports")
}

Expand All @@ -135,7 +134,10 @@ jacocoTestReport {
afterEvaluate {
classDirectories = files(classDirectories.files.collect {
// Exclude simple LinkedHashMap subclass from report
fileTree(dir: it, exclude: '**/LRUCache$LRUMap*')
fileTree(dir: it, excludes: [
'**/LRUCache$LRUMap*',
'**/JsonNodeKt*'
])
})
}
}
Expand Down

0 comments on commit dc3d688

Please sign in to comment.