summaryrefslogtreecommitdiff
path: root/events/wildcard_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'events/wildcard_test.go')
-rw-r--r--events/wildcard_test.go54
1 files changed, 0 insertions, 54 deletions
diff --git a/events/wildcard_test.go b/events/wildcard_test.go
deleted file mode 100644
index dfa65e63..00000000
--- a/events/wildcard_test.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package events
-
-import (
- "testing"
-
- "github.com/stretchr/testify/assert"
-)
-
-func TestWildcard(t *testing.T) {
- w, err := newWildcard("http.*")
- assert.NoError(t, err)
- assert.True(t, w.match("http.SuperEvent"))
- assert.False(t, w.match("https.SuperEvent"))
- assert.False(t, w.match(""))
- assert.False(t, w.match("*"))
- assert.False(t, w.match("****"))
- assert.True(t, w.match("http.****"))
-
- // *.* -> *
- w, err = newWildcard("*")
- assert.NoError(t, err)
- assert.True(t, w.match("http.SuperEvent"))
- assert.True(t, w.match("https.SuperEvent"))
- assert.True(t, w.match(""))
- assert.True(t, w.match("*"))
- assert.True(t, w.match("****"))
- assert.True(t, w.match("http.****"))
-
- w, err = newWildcard("*.WorkerError")
- assert.NoError(t, err)
- assert.False(t, w.match("http.SuperEvent"))
- assert.False(t, w.match("https.SuperEvent"))
- assert.False(t, w.match(""))
- assert.False(t, w.match("*"))
- assert.False(t, w.match("****"))
- assert.False(t, w.match("http.****"))
- assert.True(t, w.match("http.WorkerError"))
-
- w, err = newWildcard("http.WorkerError")
- assert.NoError(t, err)
- assert.False(t, w.match("http.SuperEvent"))
- assert.False(t, w.match("https.SuperEvent"))
- assert.False(t, w.match(""))
- assert.False(t, w.match("*"))
- assert.False(t, w.match("****"))
- assert.False(t, w.match("http.****"))
- assert.True(t, w.match("http.WorkerError"))
-
- w, err = newWildcard("http.Worker*")
- assert.NoError(t, err)
- assert.True(t, w.match("http.WorkerFoo"))
- assert.False(t, w.match("h*.SuperEvent"))
- assert.False(t, w.match("h*.Worker"))
-}