Skip to content

canonical-data.json: Shared data among test cases #699

Closed
@rbasso

Description

@rbasso

While working in #625, we discovered that some canonical-data.json files have data shared among test cases:

  • grep - Has a files object that encodes files to be "grepped" in multiples test cases.
  • pov - Has a trees object shared by multiple test cases, referenced by their names.

The current JSON Schema doesn't allow that, so I plan to sidestep this issue putting the offending structures in comments, temporarily, until we decide how deal with that.

I see a few option:

  • Replicate the information where it is needed: This has the advantage of keeping all test cases independent, but it hurts to ask a programmer to do it.
  • Change the schema to allow a resources/shared structure: This would avoid repetition, but also increase the complexity of test generators significantly.
  • Move from JSON to YAML: Using YAML anchors would be a clean and easy solution, but YAML is not well-supported as JSON, and that may be a problem for test generators in some languages.
  • Change the offending exercises, so that this feature isn't needed: The simple, trustworthy non-solution.

Any other option?

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