You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

31 lines
608 B

package student_test
import (
"reflect"
"testing"
"github.com/01-edu/z01"
solutions "./solutions"
student "./student"
)
func TestSortIntegerTable(t *testing.T) {
i := 0
for i < z01.SliceLen {
table := z01.MultRandIntBetween(-100, 100)
tableCopyBefore := make([]int, len(table))
copy(tableCopyBefore, table)
table2 := make([]int, len(table))
copy(table2, table)
student.SortIntegerTable(table)
solutions.SortIntegerTable(table2)
if !reflect.DeepEqual(table, table2) {
t.Fatalf("SortIntegerTable(%v), table == %v instead of %v ", tableCopyBefore, table, table2)
}
i++
}
}