mirror of https://github.com/01-edu/public.git
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.
32 lines
608 B
32 lines
608 B
5 years ago
|
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.Errorf("SortIntegerTable(%v), table == %v instead of %v ", tableCopyBefore, table, table2)
|
||
|
}
|
||
|
i++
|
||
|
}
|
||
|
}
|