From dcfba9454b9891febd4ed24286eb088e85659559 Mon Sep 17 00:00:00 2001 From: Diego Date: Wed, 24 Dec 2014 18:55:14 -0300 Subject: = core: include new test case in GlobalPathFilterSpec --- .../src/test/scala/kamon/util/GlobPathFilterSpec.scala | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'kamon-core/src/test/scala') diff --git a/kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala b/kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala index e0b837f3..47ef4701 100644 --- a/kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala +++ b/kamon-core/src/test/scala/kamon/util/GlobPathFilterSpec.scala @@ -40,7 +40,7 @@ class GlobPathFilterSpec extends WordSpecLike with Matchers { filter.accept("/user/something/otherActor") shouldBe false } - "match all expressions in all levels" in { + "match all expressions and crosses the path boundaries" in { val filter = new GlobPathFilter("/user/actor-**") filter.accept("/user/actor-") shouldBe true @@ -50,5 +50,17 @@ class GlobPathFilterSpec extends WordSpecLike with Matchers { filter.accept("/user/something/actor") shouldBe false filter.accept("/user/something/otherActor")shouldBe false } + + "match exactly one characterr" in { + val filter = new GlobPathFilter("/user/actor-?") + + filter.accept("/user/actor-1") shouldBe true + filter.accept("/user/actor-2") shouldBe true + filter.accept("/user/actor-3") shouldBe true + + filter.accept("/user/actor-one") shouldBe false + filter.accept("/user/actor-two") shouldBe false + filter.accept("/user/actor-tree") shouldBe false + } } } -- cgit v1.2.3