Skip to content

Commit

Permalink
Add case number to test name. Remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
OptimumCode committed Jul 24, 2023
1 parent 711beff commit b8586f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.github.optimumcode.json.pointer

import io.github.optimumcode.json.pointer.JsonPointer.Companion
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,16 @@ class JsonSchemaTest : FunSpec() {
),
).forEach { (refDestination, possibleRefs) ->
possibleRefs.asSequence()
.flatMap {
val uri = Uri.parse(it)
.flatMapIndexed { index, ref ->
val uri = Uri.parse(ref)
val caseNumber = index + 1
if (uri.schemeSpecificPart == "//example.com/root.json" && uri.fragment != null) {
sequenceOf(it, "#${uri.fragment}")
sequenceOf("$caseNumber" to ref, "$caseNumber.1" to "#${uri.fragment}")
} else {
sequenceOf(it)
sequenceOf("$caseNumber" to ref)
}
}.forEach { ref ->
test("$refDestination can be accessed by ref '$ref'") {
}.forEach { (caseNumber, ref) ->
test("$refDestination can be accessed ($caseNumber)") {
withClue(ref) {
shouldNotThrowAny {
JsonSchema.fromDefinition(
Expand Down

0 comments on commit b8586f0

Please sign in to comment.