mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* PLT-5860 Updated copyright date in about modal * PLT-5860 Updated copyright notice in JSX files * PLT-5860 Updated copyright notice in go files * Fixed misc copyright dates * Fixed component snapshots
47 lines
662 B
Go
47 lines
662 B
Go
// Copyright (c) 2016-present 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")
|
|
}
|
|
}
|
|
|
|
func TestRemoveDuplicatesFromStringArray(t *testing.T) {
|
|
a := []string{
|
|
"a",
|
|
"b",
|
|
"a",
|
|
"a",
|
|
"b",
|
|
"c",
|
|
"a",
|
|
}
|
|
|
|
if len(RemoveDuplicatesFromStringArray(a)) != 3 {
|
|
t.Fatal("should be 3")
|
|
}
|
|
}
|