Lines Matching +full:non +full:- +full:unique
7 // http://www.apache.org/licenses/LICENSE-2.0
21 func checkSameIntSet(t *testing.T, set *IntSet, unique []int) {
23 want := len(unique)
27 t.Errorf("NewIntSet(%v) want length %v, got %v", unique, want, got)
31 for _, s := range unique {
41 sort.Ints(unique)
44 want := unique[i]
70 unique := []int{0, 1, 2}
71 set := NewIntSet(unique...)
72 checkSameIntSet(t, set, unique)
74 // Append an already-present element.
75 nonUnique := append(unique, unique[0])
78 // Non-unique unique should collapse to one.
79 want = len(unique)
88 checkSameIntSet(t, set, unique)
108 unique := []int{0, 1, 2}
109 set := NewIntSet(unique...)
111 // Insert existing element, which should basically be a no-op.
112 set.Insert(unique[0])
113 checkSameIntSet(t, set, unique)
115 // Actually insert new unique elements (cast from enum values this time).
117 longer := append(unique, additional...)
123 unique := []int{0, 1, 2}
124 set := NewIntSet(unique...)
126 // Delete non-existent element, which should basically be a no-op.
128 checkSameIntSet(t, set, unique)
131 set.Delete(unique[1:]...)
132 checkSameIntSet(t, set, unique[:1])
194 // Check two non-empty, non-nil disjoint sets.
229 // Check A - A returns the empty set.
241 // Check A - C simply returns elements in A if A and C are disjoint.
249 // Check A - B returns elements in A not in B.
259 // Check B - A returns elements in B not in A.
273 // Check Unique(nil) returns a copy of the receiver.
275 got := setA.Unique(nil)
280 // Check Unique returns only elements in A and B not in both A and B.
282 got = setA.Unique(setB)
289 // Check Unique of two disjoint sets is the Union of those sets.
291 got = setA.Unique(setC)
299 // Check Unique is the Union of A - B and B - A.
305 got = setA.Unique(setB)
340 // Check Equal returns false for sets of non-equal length.
351 // Check Equal returns false for equal-length sets with different elements.