-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: revert to 1.1.0 url matching algorithm
- Loading branch information
1 parent
0e261b2
commit f62c2fa
Showing
10 changed files
with
79 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,38 @@ | ||
import data.shared.PackageIdentifier | ||
import data.shared.PackageIdentifier.getError | ||
import io.kotest.core.spec.style.FunSpec | ||
import io.kotest.matchers.shouldBe | ||
import io.kotest.matchers.shouldNotBe | ||
|
||
class IdentifierTests : FunSpec({ | ||
context("package identifier validity tests") { | ||
test("valid identifier is successful") { | ||
getError("Package.Identifier") shouldBe null | ||
PackageIdentifier.getError("Package.Identifier") shouldBe null | ||
} | ||
|
||
test("identifier greater than max segments fails") { | ||
getError( | ||
PackageIdentifier.getError( | ||
mutableListOf<String>().apply { repeat(9) { add("A") } }.joinToString(".") | ||
) shouldNotBe null | ||
} | ||
|
||
test("identifier greater than max length fails") { | ||
getError("A".repeat(PackageIdentifier.maxLength.inc())) shouldNotBe null | ||
PackageIdentifier.getError( | ||
"A".repeat(PackageIdentifier.validationRules.maxLength?.inc() as Int) | ||
) shouldNotBe null | ||
} | ||
|
||
test("identifier shorter than min length fails") { | ||
getError("A".repeat(PackageIdentifier.minLength.dec())) shouldNotBe null | ||
PackageIdentifier.getError( | ||
"A".repeat(PackageIdentifier.validationRules.minLength?.dec() as Int) | ||
) shouldNotBe null | ||
} | ||
|
||
test("blank or empty string fails") { | ||
getError(" ".repeat(10)) shouldNotBe null | ||
PackageIdentifier.getError(" ".repeat(10)) shouldNotBe null | ||
} | ||
|
||
test("identifier with only one segments fails") { | ||
getError("Identifier") shouldNotBe null | ||
PackageIdentifier.getError("Identifier") shouldNotBe null | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters