aboutsummaryrefslogtreecommitdiff
path: root/middleware/pkg/debug/debug_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'middleware/pkg/debug/debug_test.go')
-rw-r--r--middleware/pkg/debug/debug_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/middleware/pkg/debug/debug_test.go b/middleware/pkg/debug/debug_test.go
new file mode 100644
index 000000000..9b0d9ea4f
--- /dev/null
+++ b/middleware/pkg/debug/debug_test.go
@@ -0,0 +1,21 @@
+package debug
+
+import (
+ "strings"
+ "testing"
+)
+
+func TestIsDebug(t *testing.T) {
+ if ok := IsDebug("o-o.debug.miek.nl."); ok != "miek.nl." {
+ t.Errorf("expected o-o.debug.miek.nl. to be debug")
+ }
+ if ok := IsDebug(strings.ToLower("o-o.Debug.miek.nl.")); ok != "miek.nl." {
+ t.Errorf("expected o-o.Debug.miek.nl. to be debug")
+ }
+ if ok := IsDebug("i-o.debug.miek.nl."); ok != "" {
+ t.Errorf("expected i-o.Debug.miek.nl. to be non-debug")
+ }
+ if ok := IsDebug(strings.ToLower("i-o.Debug.")); ok != "" {
+ t.Errorf("expected o-o.Debug. to be non-debug")
+ }
+}