github.com/auxten/ginkgo@v0.0.0-20220130172820-7d98ad59d232/seed/dedup_test.go (about) 1 package seed 2 3 import ( 4 "testing" 5 6 . "github.com/smartystreets/goconvey/convey" 7 ) 8 9 func TestSortDeDup(t *testing.T) { 10 Convey("sort and deduplicate", t, func() { 11 l := []Host{ 12 {[4]byte{10, 0, 0, 1}, 10}, 13 } 14 sl := SortDeDup(l) 15 So(sl, ShouldResemble, []Host{ 16 {[4]byte{10, 0, 0, 1}, 10}, 17 }) 18 }) 19 Convey("sort and deduplicate", t, func() { 20 l := []Host{ 21 {[4]byte{10, 0, 0, 1}, 10}, 22 {[4]byte{10, 0, 0, 1}, 10}, 23 {[4]byte{10, 0, 0, 2}, 10}, 24 {[4]byte{10, 0, 0, 1}, 8}, 25 } 26 sl := SortDeDup(l) 27 So(sl, ShouldResemble, []Host{ 28 {[4]byte{10, 0, 0, 1}, 8}, 29 {[4]byte{10, 0, 0, 1}, 10}, 30 {[4]byte{10, 0, 0, 2}, 10}, 31 }) 32 }) 33 }