Exemple #1
0
func TestSectionSliceSort(t *testing.T) {
	want := []int{-10, 1, 10, 11, 20}
	ss := config.SectionSlice{
		&config.Section{ID: "a", SortOrder: 20},
		&config.Section{ID: "b", SortOrder: -10},
		&config.Section{ID: "c", SortOrder: 10},
		&config.Section{ID: "d", SortOrder: 11},
		&config.Section{ID: "e", SortOrder: 1},
	}
	for i, f := range *(ss.Sort()) {
		assert.EqualValues(t, want[i], f.SortOrder)
	}

}