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.

28 lines
660 B

package student_test
import (
"testing"
solutions "./solutions"
student "./student"
"github.com/01-edu/z01"
)
func TestJoin(t *testing.T) {
arg1 := []string{"hello", "how", "are", "you", "doing"}
arg2 := []string{"fine", "and", "you"}
arg3 := []string{"I'm", "O.K."}
seps := []string{" ", "-", " ,", "_", "SPC", " . "}
args := [][]string{arg1, arg2, arg3}
for i := 0; i < 5; i++ {
//random position for the array of arguments
posA := z01.RandIntBetween(0, len(args)-1)
//random position for the array of separators
posS := z01.RandIntBetween(0, len(seps)-1)
z01.Challenge(t, student.Join, solutions.Join, args[posA], seps[posS])
}
}