Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pig-latin: Remove call to Printf in tests and use sub-tests #2230

Closed
andrerfcsantos opened this issue Jun 4, 2022 · 1 comment · Fixed by #2231
Closed

pig-latin: Remove call to Printf in tests and use sub-tests #2230

andrerfcsantos opened this issue Jun 4, 2022 · 1 comment · Fixed by #2231
Assignees
Labels
good first issue x:action/improve Improve existing functionality/content x:knowledge/none No existing Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:size/small Small amount of work x:type/content Work on content (e.g. exercises, concepts)

Comments

@andrerfcsantos
Copy link
Member

While testing solutions locally for the exercises in the track, I noticed that the exercise pig-latin has a direct call to fmt.Printf:

fmt.Printf("PASS: %s\n", test.description)

This makes it so just running go test produces output, which is not desirable. I understand this call to print was probably an attempt to explicitly print which tests failed and which ones passed, but the go command itself can print the result of individual tests in verbose mode with go test -v - the tests themselves shouldn't print if they passed or failed.

While removing this call to print, we can make this exercise use sub-tests, as discussed in #2098

The tasks here are:

  • Remove the call to fmt.Printf on the tests
  • Remove PASS: and FAIL: from strings - go test -v can provide this kind of output based just on the test (or sub-test) results
  • Make exercise use sub-tests (example in Migrate data-driven tests to subtests #2098)
@andrerfcsantos andrerfcsantos added good first issue x:action/improve Improve existing functionality/content x:knowledge/none No existing Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:type/content Work on content (e.g. exercises, concepts) x:size/small Small amount of work labels Jun 4, 2022
@Satho-M
Copy link
Contributor

Satho-M commented Jun 5, 2022

I can work on this one if nobody else is already.

Satho-M added a commit to Satho-M/exercism-go that referenced this issue Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue x:action/improve Improve existing functionality/content x:knowledge/none No existing Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:size/small Small amount of work x:type/content Work on content (e.g. exercises, concepts)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants