MCPcopy
hub / github.com/git-lfs/git-lfs / TestOrderedSetUnion

Function TestOrderedSetUnion

tools/ordered_set_test.go:82–94  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

80}
81
82func TestOrderedSetUnion(t *testing.T) {
83 s1 := NewOrderedSetFromSlice([]string{"a"})
84 s2 := NewOrderedSetFromSlice([]string{"b", "a"})
85
86 elems := make([]string, 0)
87 for e := range s1.Union(s2).Iter() {
88 elems = append(elems, e)
89 }
90
91 require.Len(t, elems, 2)
92 assert.Equal(t, "a", elems[0])
93 assert.Equal(t, "b", elems[1])
94}
95
96func TestOrderedSetIntersect(t *testing.T) {
97 s1 := NewOrderedSetFromSlice([]string{"a"})

Callers

nothing calls this directly

Calls 5

NewOrderedSetFromSliceFunction · 0.85
IterMethod · 0.45
UnionMethod · 0.45
LenMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected