2021-12-06 08:01:25 +02:00
|
|
|
package sorting
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestSelection(t *testing.T) {
|
|
|
|
CheckSorter(NewSelection())
|
|
|
|
}
|
2021-12-14 12:35:28 +02:00
|
|
|
|
|
|
|
func BenchmarkSelection(b *testing.B) {
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
BenchmarkSort(10000, NewSelection())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestInsertion(t *testing.T) {
|
|
|
|
CheckSorter(NewInsertion())
|
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkInsertion(b *testing.B) {
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
BenchmarkSort(10000, NewInsertion())
|
|
|
|
}
|
|
|
|
}
|
2021-12-14 14:01:44 +02:00
|
|
|
|
|
|
|
func TestShell(t *testing.T) {
|
|
|
|
CheckSorter(NewShell())
|
|
|
|
}
|
|
|
|
|
|
|
|
func BenchmarkShell(b *testing.B) {
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
|
|
BenchmarkSort(10000, NewShell())
|
|
|
|
}
|
|
|
|
}
|