union_test.go 313 B

12345678910111213
  1. package help
  2. import "testing"
  3. func TestUnion(t *testing.T) {
  4. input1 := []int{1, 2, 3}
  5. input2 := []int{2, 4, 5, 1}
  6. want := []interface{}{1, 2, 3, 4, 5}
  7. if q := From(input1).Union(From(input2)); !validateQuery(q, want) {
  8. t.Errorf("From(%v).Union(%v)=%v expected %v", input1, input2, toSlice(q), want)
  9. }
  10. }