17 lines
448 B
Go
17 lines
448 B
Go
package mysql
|
|
|
|
import (
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestSplitHumanRobotAllowedOwnerIDs(t *testing.T) {
|
|
shortIDs, userIDs := splitHumanRobotAllowedOwnerIDs([]string{" 1001 ", "abc", "1001", "1e3", "-2", ""})
|
|
if !reflect.DeepEqual(shortIDs, []string{"1001", "abc", "1e3", "-2"}) {
|
|
t.Fatalf("short ids mismatch: got %+v", shortIDs)
|
|
}
|
|
if !reflect.DeepEqual(userIDs, []int64{1001}) {
|
|
t.Fatalf("owner user ids mismatch: got %+v", userIDs)
|
|
}
|
|
}
|