package helper
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func Test_Diff(t *testing.T) {
|
|
var aa = []string{"43", "33"}
|
|
var bb = []string{"2", "33", "1"}
|
|
cc := Diff(aa, bb)
|
|
fmt.Println(cc)
|
|
}
|
|
|
|
func Test_Intersect(t *testing.T) {
|
|
var aa = []string{"43", "33"}
|
|
var bb = []string{"2", "33", "1"}
|
|
cc := Intersect(aa, bb)
|
|
fmt.Println(cc)
|
|
}
|
|
|
|
func Test_Union(t *testing.T) {
|
|
var aa = []string{"43", "33"}
|
|
var bb = []string{"2", "33", "1"}
|
|
cc := Union(aa, bb)
|
|
fmt.Println(cc)
|
|
}
|
|
|
|
func Test_Unique(t *testing.T) {
|
|
var str = []string{"1", "2", "2"}
|
|
ret, err := Unique(str)
|
|
fmt.Println(ret, err)
|
|
}
|
|
|
|
func Test_StringSliceSort(t *testing.T) {
|
|
var str = []string{"10", "2", "5"}
|
|
ret, err := StringSliceSort(str,"asc")
|
|
fmt.Println(ret, err)
|
|
ret2, err := StringSliceSort(str,"desc")
|
|
fmt.Println(ret2, err)
|
|
}
|