func generateIntSlice(count int) stdsort.IntSlice {
	is := make([]int, count)
	for i := 0; i < count; i++ {
		is[i] = rand.Int()
	}
	return is
}
generateIntSlice generates a slice of ints.
package sort_test
import (
	"math/rand"
	stdsort "sort"
	"testing"
	"time"
	"github.com/tideland/golib/audit"
	"github.com/tideland/golib/sort"
)
func TestPivot(t *testing.T) {
	assert := audit.NewTestingAssertion(t, true)
	td := ByteSlice{17, 20, 13, 15, 51, 6, 21, 11, 23, 47, 59, 88, 78, 67, 94}
	plh, puh := sort.Partition(td, 0, len(td)-1)
	assert.Equal(plh, 3, "Pivot lower half.")
	assert.Equal(puh, 5, "Pivot upper half.")
	assert.Equal(td[puh-1], byte(17), "Data at median.")
	assert.Equal(td, ByteSlice{11, 13, 15, 6, 17, 20, 21, 94, 23, 47, 59, 88, 78, 67, 51}, "Prepared data.")
}
func BenchmarkStandardSort(b *testing.B) {
	is := generateIntSlice(b.N)
	stdsort.Sort(is)
}
func BenchmarkInsertionSort(b *testing.B) {
	is := generateIntSlice(b.N)
	sort.InsertionSort(is, 0, len(is)-1)
}
func BenchmarkSequentialQuickSort(b *testing.B) {
	is := generateIntSlice(b.N)
	sort.SequentialQuickSort(is, 0, len(is)-1)
}
func BenchmarkParallelQuickSort(b *testing.B) {
	is := generateIntSlice(b.N)
	sort.Sort(is)
}
type ByteSlice []byte
func (bs ByteSlice) Len() int           { return len(bs) }
func (bs ByteSlice) Less(i, j int) bool { return bs[i] < bs[j] }
func (bs ByteSlice) Swap(i, j int)      { bs[i], bs[j] = bs[j], bs[i] }