-
-
Notifications
You must be signed in to change notification settings - Fork 19
Replace print commands without final newline #6
Copy link
Copy link
Open
Labels
x:action/fixFix an issueFix an issuex:knowledge/elementaryLittle Exercism knowledge requiredLittle Exercism knowledge requiredx:module/test-runnerWork on Test RunnersWork on Test Runnersx:size/mediumMedium amount of workMedium amount of workx:type/codingWrite code that is not student-facing content (e.g. test-runners, generators, but not exercises)Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)
Metadata
Metadata
Assignees
Labels
x:action/fixFix an issueFix an issuex:knowledge/elementaryLittle Exercism knowledge requiredLittle Exercism knowledge requiredx:module/test-runnerWork on Test RunnersWork on Test Runnersx:size/mediumMedium amount of workMedium amount of workx:type/codingWrite code that is not student-facing content (e.g. test-runners, generators, but not exercises)Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)
The commands
print,fmt.Print,fmt.Printfand maybe others currently destroy the output ofgo test --jsonas they have no final newline.We should report that to be fixed in
go testbut for the time being we will replace these commands in students solutions withprintln/fmt.Println.My current suggestion would be to add some
sedcommands 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->printlnfmt.Print->fmt.Printlnfmt.Printf(...)->fmt.Println(fmt.Sprintf(...))