Skip to content

Update documentation about problem data files #374

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

Merged
merged 1 commit into from
Sep 10, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,40 @@ The `doc/` subdirectory contains all documentation that is not specific to a lan

Please see the [contributing guide](https://github.com/exercism/x-common/blob/master/CONTRIBUTING.md)

## Test Data Format
## Problem metadata

Each problem's data lives in a directory under `exercises/`

```
exercises/
├── accumulate
│   ├── description.md
│   └── metadata.yml
├── ...
├── minesweeper
│   ├── canonical-data.json
│   ├── description.md
│   └── metadata.yml
├── ...
└── zipper
├── description.md
└── metadata.yml
```

There are three metadata files:

* `description.md` - the basic problem description
* `metadata.yml` - additional information about the problem, such as where it came from
* `canonical-data.json` (optional) - standardized test inputs and outputs that can be used to implement the problem

## Test Data Format (canonical-data.json)

Each problem can have a file <problem>.json containing standard test data.
This data can be incorporated into test programs manually or extracted by a
program. The file contains a single JSON object with a key for documentation
and keys for various tests that may be meaningful for a problem.

The documentation uses the key "#" with a list of strings as the value.
These strings document how the problem readme (&lt;problem>.md) is generally
These strings document how the problem readme (`description.md`) is generally
interpreted in test programs across different languages. In addition to a
mainstream implementation path, this information can also document significant
variations.
Expand All @@ -28,7 +53,7 @@ Each test case has the the following keys:

## Automated Tests

The only thing that we're testing at the moment, is whether or not shared test data
The only thing that we're testing at the moment, is whether or not `canonical-data.json`
is valid json.

If you want to run this before you commit, you will need to install
Expand Down