Replace print
commands without final newline
#6
Labels
x:action/fix
Fix an issue
x:knowledge/elementary
Little Exercism knowledge required
x:module/test-runner
Work on Test Runners
x:size/medium
Medium amount of work
x:type/coding
Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)
The commands
print
,fmt.Print
,fmt.Printf
and maybe others currently destroy the output ofgo test --json
as they have no final newline.We should report that to be fixed in
go test
but for the time being we will replace these commands in students solutions withprintln
/fmt.Println
.My current suggestion would be to add some
sed
commands to the test runner before executing the tests. This could also be done using the AST library to manipulate the AST if someone wants to dig into that.Here the replace table I'd recommend to avoid having to remove/add imports:
print
->println
fmt.Print
->fmt.Println
fmt.Printf(...)
->fmt.Println(fmt.Sprintf(...))
The text was updated successfully, but these errors were encountered: