Skip to content

Commit 9948715

Browse files
author
Katrina Owen
authored
Merge pull request #374 from exercism/readme
Update documentation about problem data files
2 parents 47a2f5c + a923847 commit 9948715

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,40 @@ The `doc/` subdirectory contains all documentation that is not specific to a lan
77

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

10-
## Test Data Format
10+
## Problem metadata
11+
12+
Each problem's data lives in a directory under `exercises/`
13+
14+
```
15+
exercises/
16+
├── accumulate
17+
│   ├── description.md
18+
│   └── metadata.yml
19+
├── ...
20+
├── minesweeper
21+
│   ├── canonical-data.json
22+
│   ├── description.md
23+
│   └── metadata.yml
24+
├── ...
25+
└── zipper
26+
├── description.md
27+
└── metadata.yml
28+
```
29+
30+
There are three metadata files:
31+
32+
* `description.md` - the basic problem description
33+
* `metadata.yml` - additional information about the problem, such as where it came from
34+
* `canonical-data.json` (optional) - standardized test inputs and outputs that can be used to implement the problem
35+
36+
## Test Data Format (canonical-data.json)
1137

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

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

2954
## Automated Tests
3055

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

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

0 commit comments

Comments
 (0)