Skip to content

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

@petertseng

Description

@petertseng

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions