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

Function TestOrderedSetIter

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

Source from the content-addressed store, hash-verified

163}
164
165func TestOrderedSetIter(t *testing.T) {
166 s1 := NewOrderedSetFromSlice([]string{"a", "b", "c"})
167
168 elems := make([]string, 0)
169 for e := range s1.Iter() {
170 elems = append(elems, e)
171 }
172
173 require.Len(t, elems, 3)
174 assert.Equal(t, "a", elems[0])
175 assert.Equal(t, "b", elems[1])
176 assert.Equal(t, "c", elems[2])
177}
178
179func TestOrderedSetEqualReturnsTrueWhenSameElementsInSameOrder(t *testing.T) {
180 s1 := NewOrderedSetFromSlice([]string{"a", "b", "c"})

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected