MCPcopy Index your code
hub / github.com/git-lfs/git-lfs / TestOrderedSetIntersect

Function TestOrderedSetIntersect

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

Source from the content-addressed store, hash-verified

94}
95
96func TestOrderedSetIntersect(t *testing.T) {
97 s1 := NewOrderedSetFromSlice([]string{"a"})
98 s2 := NewOrderedSetFromSlice([]string{"b", "a"})
99
100 elems := make([]string, 0)
101 for e := range s1.Intersect(s2).Iter() {
102 elems = append(elems, e)
103 }
104
105 require.Len(t, elems, 1)
106 assert.Equal(t, "a", elems[0])
107}
108
109func TestOrderedSetDifference(t *testing.T) {
110 s1 := NewOrderedSetFromSlice([]string{"a", "b"})

Callers

nothing calls this directly

Calls 5

NewOrderedSetFromSliceFunction · 0.85
IterMethod · 0.45
IntersectMethod · 0.45
LenMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected