diff --git a/solutions/ascii.go b/solutions/ascii.go new file mode 100644 index 00000000..755d408c --- /dev/null +++ b/solutions/ascii.go @@ -0,0 +1,5 @@ +package solutions + +func Ascii(str string) []byte { + return []byte(str) +} diff --git a/tests/ascii_test/main.go b/tests/ascii_test/main.go new file mode 100644 index 00000000..b5f39d09 --- /dev/null +++ b/tests/ascii_test/main.go @@ -0,0 +1,27 @@ +package main + +import ( + student "student" + + "github.com/01-edu/go-tests/lib/challenge" + "github.com/01-edu/go-tests/lib/random" + "github.com/01-edu/go-tests/solutions" +) + +func main() { + allAscii := "" + for i := 0; i <= 255; i++ { + allAscii += string(i) + } + args := []string{ + "", + random.Str(allAscii, 1), + random.Str(allAscii, 8), + "Instead of this many random tests leave just a few and add some tests with long strings and multiple spaces", + "one two three four ", + } + + for _, arg := range args { + challenge.Function("Ascii", student.Ascii, solutions.Ascii, arg) + } +}