func TestSortOK(t *testing.T) {
	for n := 0; n < 10; n++ {
		t.Run(fmt.Sprintf("iteration %d:", n), func(t *testing.T) {
			toSort := generateRandomTags(20, 10)
			selSort := make([]string, len(toSort))
			copy(selSort, toSort)
			stdSort := make([]string, len(toSort))
			copy(stdSort, toSort)

			util.InsertionSort(selSort)
			sort.Strings(stdSort)

			assert.Equal(t, stdSort, selSort)
		})
	}
}
// Unit testing: compare selection sort with stdlib on random slices
Unit testing: compare selection sort with stdlib on random slices
// Unit testing : compare selection sort with stdlib on random slices
func TestSortOK(t *testing.T) {
	for n := 0; n < 10; n++ {
		t.Run(fmt.Sprintf("iteration %d:", n), func(t *testing.T) {
			toSort := generateRandomTags(20, 10)
			selSort := make([]string, len(toSort))
			copy(selSort, toSort)
			stdSort := make([]string, len(toSort))
			copy(stdSort, toSort)
			util.InsertionSort(selSort)
			sort.Strings(stdSort)
			assert.Equal(t, stdSort, selSort)
		})
	}
}
func TestSortOK ( t * testing . T ) { for n := 0 ; n < 10 ; n ++ { t . Run ( fmt . Sprintf ( " " , n ) , func ( t * testing . T ) { toSort := generateRandomTags ( 20 , 10 ) selSort := make ( [ ] string , len ( toSort ) ) copy ( selSort , toSort ) stdSort := make ( [ ] string , len ( toSort ) ) copy ( stdSort , toSort ) util . InsertionSort ( selSort ) sort . Strings ( stdSort ) assert . Equal ( t , stdSort , selSort ) } ) } }
Unit testing: compare selection sort with stdlib on random slices
Unit testing : compare selection sort with stdlib on random slices