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.
40 lines
759 B
40 lines
759 B
5 years ago
|
package main
|
||
5 years ago
|
|
||
|
import (
|
||
|
"reflect"
|
||
5 years ago
|
"strings"
|
||
5 years ago
|
|
||
|
"github.com/01-edu/z01"
|
||
|
|
||
|
solutions "./solutions"
|
||
|
student "./student"
|
||
|
)
|
||
|
|
||
5 years ago
|
func main() {
|
||
|
table := [][]string{{"a", "A", "1", "b", "B", "2", "c", "C", "3"}}
|
||
5 years ago
|
|
||
5 years ago
|
table = append(table, z01.MultMultRandWords()...)
|
||
5 years ago
|
|
||
|
for _, org := range table {
|
||
5 years ago
|
// copy for using the solution function
|
||
5 years ago
|
cp_sol := make([]string, len(org))
|
||
5 years ago
|
// copy for using the student function
|
||
5 years ago
|
cp_stu := make([]string, len(org))
|
||
|
|
||
|
copy(cp_sol, org)
|
||
|
copy(cp_stu, org)
|
||
|
|
||
5 years ago
|
solutions.AdvancedSortWordArr(cp_sol, strings.Compare)
|
||
|
student.AdvancedSortWordArr(cp_stu, strings.Compare)
|
||
5 years ago
|
|
||
|
if !reflect.DeepEqual(cp_stu, cp_sol) {
|
||
5 years ago
|
z01.Fatalf("%s(%v) == %v instead of %v\n",
|
||
5 years ago
|
"AdvancedSortWordArr",
|
||
|
org,
|
||
|
cp_stu,
|
||
|
cp_sol,
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
}
|