Skip to content

Commit

Permalink
implement additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
varshith257 committed Jun 17, 2024
1 parent 01c7cd8 commit 0779442
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions zio-http/jvm/src/test/scala/zio/http/RoutePatternSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -402,20 +402,14 @@ object RoutePatternSpec extends ZIOHttpSpec {
def anyOfTests =
suite("anyOf")(
test("anyOf with multiple patterns") {
val routePattern = Method.GET / anyOf("", "index.html", "index.htm")

println("Testing routePattern with empty path:")
println(routePattern.matches(Method.GET, Path("")))

println("Testing routePattern with index.html path:")
println(routePattern.matches(Method.GET, Path("index.html")))

println("Testing routePattern with index.htm path:")
println(routePattern.matches(Method.GET, Path("index.htm")))

assertTrue(routePattern.matches(Method.GET, Path("")))
assertTrue(routePattern.matches(Method.GET, Path("index.html")))
assertTrue(routePattern.matches(Method.GET, Path("index.htm")))
val routePattern = Method.GET / anyOf("", "index.html", "index.htm")
assertTrue(
routePattern.matches(Method.GET, Path("")),
routePattern.matches(Method.GET, Path("index.html")),
routePattern.matches(Method.GET, Path("index.htm")),
!routePattern.matches(Method.GET, Path("foo"))
!routePattern.matches(Method.POST, Path("index.html"))
)
},
)

Expand Down

0 comments on commit 0779442

Please sign in to comment.