Browse Source

Remove additional examples in cases of errors and handled error check

Because it was causing issues with ztail kind of exercises where the
program can fail but the error message can be any line
content-update
Xavier Petit 4 years ago
parent
commit
2bd1c8c884
No known key found for this signature in database
GPG Key ID: CA3F2B17E25ABD26
  1. 18
      go/tests/lib/lib.go

18
go/tests/lib/lib.go

@ -389,23 +389,7 @@ func ChallengeMainStdin(exercise, input string, args ...string) {
code(studentCode) + "\n\n" +
"Expected :\n" +
console(solution) +
code(solutionCode) + "\n\n" +
"Another example :\n" +
console("ERROR\n") +
code(1))
}
firstLine := strings.SplitN(student, "\n", 1)[0]
handledError := strings.Contains(firstLine, "ERROR")
if !handledError {
Fatalln(`Your program does not handle the error, the first line of the output must contain "ERROR" :` + "\n" +
console(student) +
code(studentCode) + "\n\n" +
"Expected :\n" +
console(solution) +
code(solutionCode) + "\n\n" +
"Another example :\n" +
console("ERROR\n") +
code(1))
code(solutionCode))
}
}
if student != solution {

Loading…
Cancel
Save