summaryrefslogtreecommitdiffstats
path: root/utils/utils_test.go
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-05-27 08:35:55 -0700
committerCorey Hulen <corey@hulen.com>2016-05-27 08:35:55 -0700
commit0d0734ac9845ef32c55ebf4c3185ba85065c5940 (patch)
treeaaaf2522d8cacbf06fce4aee0d89aac1f1d9ec19 /utils/utils_test.go
parent1e7805b79025823fba4479ffaa354e9c756d6622 (diff)
downloadchat-0d0734ac9845ef32c55ebf4c3185ba85065c5940.tar.gz
chat-0d0734ac9845ef32c55ebf4c3185ba85065c5940.tar.bz2
chat-0d0734ac9845ef32c55ebf4c3185ba85065c5940.zip
Added duplicated trigger validation (#3124)
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")
+ }
+}