summaryrefslogtreecommitdiffstats
path: root/utils/utils_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils/utils_test.go')
-rw-r--r--utils/utils_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/utils/utils_test.go b/utils/utils_test.go
new file mode 100644
index 000000000..41e995e63
--- /dev/null
+++ b/utils/utils_test.go
@@ -0,0 +1,30 @@
+// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+package utils
+
+import (
+ "testing"
+)
+
+func TestStringArrayIntersection(t *testing.T) {
+ a := []string{
+ "abc",
+ "def",
+ "ghi",
+ }
+ b := []string{
+ "jkl",
+ }
+ c := []string{
+ "def",
+ }
+
+ if len(StringArrayIntersection(a, b)) != 0 {
+ t.Fatal("should be 0")
+ }
+
+ if len(StringArrayIntersection(a, c)) != 1 {
+ t.Fatal("should be 1")
+ }
+}