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

tournament: Should invalid lines result in an error, or be ignored? #286

Closed
petertseng opened this issue Jul 2, 2016 · 1 comment
Closed

Comments

@petertseng
Copy link
Member

petertseng commented Jul 2, 2016

The tracks that implement tournament:

http://x.exercism.io/problems/tournament

The README at https://github.com/exercism/x-common/blob/master/tournament.md says "Your program should only accept inputs that follow this format." courtesy of #254.

Can we get some clarity on what "should only accept" means?

If there is a file containing some valid lines plus some invalid lines, what should happen?

  • Ignore the invalid lines. Output the expected output for the valid lines (csharp, fsharp, rust, swift)
  • Output an error for the entire thing (go)

Currently, "should only accept" to me sounds like the approach that the go track is taking is correct!

I think we should pick one of the following:

  1. Leave README as-is. All tracks other than xgo should update tests to reject inputs with invalid line.
  2. Change README to read "should only process input lines that follow this format, and ignore all other lines". Then xgo will either update its test expectations... Edit: or not, because xgo explicitly calls out the behavior difference at https://github.com/exercism/xgo/blob/master/exercises/tournament/tournament_test.go#L12.
  3. Change README to explicitly point out that individual tracks might choose their behavior in the presence of invalid lines. This puts more work on students, they have to figure out what behavior is used by the track they are working on currently.
  4. Status quo, leave everything ambiguous and see if anyone complains. No action required on anyone's part. Until someone complains.

I do not particularly care which we pick since of the tracks I'm interested in both camps are represented. But we should pick something consistent, no? (Which means I want something other than 4)

@petertseng
Copy link
Member Author

Oh. Just realised that xgo is already aware that its behavior is an exception from all other tracks, and has called itself out at https://github.com/exercism/xgo/blob/master/exercises/tournament/tournament_test.go#L12 . I'm editing my second choice to reflect that. In that case xgo can stay as the outlier and we'd only need to change the README here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant