From 5863bf9480433bf25aca75fbc1907ac3c94a8573 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 30 Sep 2020 13:11:40 +0200 Subject: [PATCH 01/13] Replace optional key with scenarios --- .travis.yml | 2 +- README.md | 6 ++--- OPTIONAL-KEYS.txt => SCENARIOS.txt | 1 + bin/check_optional | 39 ------------------------------ canonical-schema.json | 19 ++++++++++----- 5 files changed, 18 insertions(+), 49 deletions(-) rename OPTIONAL-KEYS.txt => SCENARIOS.txt (72%) delete mode 100755 bin/check_optional diff --git a/.travis.yml b/.travis.yml index 07a78331c9..6067f29b2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,6 @@ node_js: cache: yarn script: + # TODO: add automation to check the "scenario" field - bin/check_required_files_present - - bin/check_optional - yarn test diff --git a/README.md b/README.md index 7f56d8f496..915e9b869b 100644 --- a/README.md +++ b/README.md @@ -95,8 +95,8 @@ is easier to understand with an example: , "expected" : null } , { "uuid" : "8790a635-e8a8-4343-a29f-7da2929b9378" - , "description": "Foo'ing a very big number returns nothing" - , "optional" : "big-ints" + , "description": "Foo'ing a very big number returns nothing" + , "scenarios" : ["big-ints"] , "comments" : [ "Making this test case pass requires using BigInts." ] , "property" : "foo" , "input" : { @@ -131,7 +131,7 @@ There are also some conventions that must be followed: - If an error is expected (because the input is invalid, or any other reason), the value at `"expected"` should be an object containing exactly one property, `"error"`, whose value is a string. - The string should explain why the error would occur. - A particular track's implementation of the exercise **need not** necessarily check that the error includes that exact string as the cause, depending on what is idiomatic in the language (it may not be idiomatic to check strings for error messages). - - Test cases that only some tracks should implement, for example because it would unnecessarily increase the complexity of the exercise in some but not all languages, mark it with an `optional`-key. Multiple cases related to the same reason for optionality should have the same key. The decision that a test case is optional will often be made in the PR discussion, so don't worry about it too much while creating a PR. + - The [`SCENARIOS.txt`](./SCENARIOS.txt) file contains a set of scenarios. If one or more of these scenarios apply to a test case, they should be included in its `scenarios` field. - Each test case must have a unique UUID specified in its `"uuid"` key. A UUID can be randomly generated using the [UUID Generator](https://www.uuidgenerator.net/version4). The `canonical.json` file can be validated against its schema prior to commiting using https://www.jsonschemavalidator.net/ with... diff --git a/OPTIONAL-KEYS.txt b/SCENARIOS.txt similarity index 72% rename from OPTIONAL-KEYS.txt rename to SCENARIOS.txt index a063b289f1..12e0166f75 100644 --- a/OPTIONAL-KEYS.txt +++ b/SCENARIOS.txt @@ -1,3 +1,4 @@ floating-point big-integer unicode +library-test diff --git a/bin/check_optional b/bin/check_optional deleted file mode 100755 index 7d9aaf272d..0000000000 --- a/bin/check_optional +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -# This script checks that 'optional' fields in canonical-data.json are listed. - -optional_keys_file=OPTIONAL-KEYS.txt -allowed_optional=$(jq -nR '[inputs]' $optional_keys_file) - -failed=0 - -check_optional_for_file() { - json_file=$1 - echo "Checking 'optional' fields in $json_file" - - present_optional=$(jq '[ .cases[] | recurse(.cases[]?) | .optional | select(. != null) ]' $json_file) - invalid_optional=$(jq --null-input \ - --argjson allowed "$allowed_optional" \ - --argjson present "$present_optional" \ - --raw-output '$present - $allowed | join("\n")') - - if [ ! -z "$invalid_optional" ]; then - echo "Invalid optional fields:" - echo "$invalid_optional" | perl -pe 's/^/ - /' - echo - - failed=1 - fi -} - -for json_file in $(git diff --name-only master HEAD | grep '^exercises/.*/canonical-data\.json$'); do - check_optional_for_file $json_file -done - -if [ $failed -gt 0 ]; then - echo "Allowed optional fields (see $optional_keys_file) are:" - cat $optional_keys_file | perl -pe 's/^/ - /' - exit 1 -fi - -exit 0 diff --git a/canonical-schema.json b/canonical-schema.json index e12a7441bc..90675f26fc 100644 --- a/canonical-schema.json +++ b/canonical-schema.json @@ -80,7 +80,7 @@ , "properties" : { "uuid" : { "$ref": "#/definitions/uuid" } , "description": { "$ref": "#/definitions/description" } - , "optional" : { "$ref": "#/definitions/optional" } + , "scenarios" : { "$ref": "#/definitions/scenarios" } , "comments" : { "$ref": "#/definitions/comments" } , "property" : { "$ref": "#/definitions/property" } , "input" : { "$ref": "#/definitions/input" } @@ -95,7 +95,7 @@ , "required" : ["description", "cases"] , "properties" : { "description": { "$ref": "#/definitions/description" } - , "optional" : { "$ref": "#/definitions/optional" } + , "scenarios" : { "$ref": "#/definitions/scenarios" } , "comments" : { "$ref": "#/definitions/comments" } , "cases" : { "$ref": "#/definitions/testGroup" } } @@ -113,10 +113,17 @@ , "pattern" : "^[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}$" }, - "optional": - { "description": "An identifier for similar optional test cases (kebab-case)" - , "type" : "string" - , "pattern" : "^[a-z]+(-[a-z]+)*$" + "scenario": + { "description": "An identifier for a specific scenario (kebab-case)" + , "type": "string" + , "pattern": "^[a-z]+(-[a-z]+)*$" + }, + + "scenarios": + { "description": "An array of scenarios that can be used to include/exclude test cases" + , "type" : "array" + , "items" : { "$ref": "#/definitions/scenario" } + , "minItems" : 0 }, "property": From 872c404f6c912d03655e8ac8a9721d180728aa5c Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 30 Sep 2020 14:10:19 +0200 Subject: [PATCH 02/13] Update README --- README.md | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 915e9b869b..b1b57d2a06 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Shared metadata for Exercism exercises. ## Contributing Guide -Please see the [contributing guide](https://github.com/exercism/problem-specifications/blob/master/CONTRIBUTING.md) +Please see the [contributing guide](./CONTRIBUTING.md) ## Problem metadata @@ -32,11 +32,27 @@ There are three metadata files: * `metadata.yml` - additional information about the problem, such as where it came from * `canonical-data.json` - standardized test inputs and outputs that can be used to implement the problem -## Test Data Format (canonical-data.json) +## Exercises -This data can be incorporated into test programs manually or extracted by a -program. The file format is described in [canonical-schema.json](https://github.com/exercism/problem-specifications/blob/master/canonical-schema.json), but it -is easier to understand with an example: +The following must apply to all exercise: + +- Exercises must contain tests that cover the public interface of the exercise (also thought of as "application tests"). +- Exercises may contain tests that cover the private or lower-level interface of the exercise (sometimes refered to as "library tests"). + +## Test Data (canonical-data.json) + +This data can be incorporated into test programs manually or extracted by a program. + +- Test cases are immutable, which means that once a test case has been added, it never changes. There are two exceptions: + - The `comments` field _can_ be mutated and thus does not require adding a new test case when changing its value. + - The `scenarios` field _can_ be mutated additively, by adding new scenarios. Existing scenarios must not be changed or removed. Adding new scenarios thus does not require adding a new test case. +- Test cases must all be considered optional, insomuch that a track should determine per test case whether to implement it or not. +- Each test case has a [UUID (v4)](https://en.wikipedia.org/wiki/Universally_unique_identifier) to uniquely identify it. +- If tracks automatically generate test suites from test data, they must do that based on an explicit list of test cases to include/exclude. Test cases are to be identified by their UUID, and we'll provide tooling to help keep track of which test cases to include/exclude. + +## Test Data Format + +The file format is described in [canonical-schema.json](./canonical-schema.json), but it is easier to understand with an example: ```json { "exercise": "foobar" @@ -117,24 +133,28 @@ is easier to understand with an example: } ] } - ``` -Keep in mind that the description should not simply explain **what** each case -is (that is redundant information) but also **why** each case is there. For -example, what kinds of implementation mistakes might this case help us find? +## Scenarios + +- The `scenarios` field can use one or more of a predefined set of values, which are defined in a [`SCENARIOS.txt`](./SCENARIOS.txt) file. +- The `scenarios` field can be mutated additively, by adding new scenarios. Existing scenarios must not be changed or removed. Adding new scenarios does therefore does not mean adding a new test case. +- Library tests will have a `library-test` scenario added to allow for easy including/excluding of library tests. Application tests won't have their own scenario, as they must be included and should not be filtered on. + +## Conventions There are also some conventions that must be followed: + - Descriptions should not simply explain **what** each case is (that is redundant information) but also **why** each case is there. For example, what kinds of implementation mistakes might this case help us find? - All keys should follow the [lowerCamelCase](http://wiki.c2.com/?LowerCamelCase) convention. - If the input is valid but there is no result for the input, the value at `"expected"` should be `null`. - If an error is expected (because the input is invalid, or any other reason), the value at `"expected"` should be an object containing exactly one property, `"error"`, whose value is a string. - The string should explain why the error would occur. - A particular track's implementation of the exercise **need not** necessarily check that the error includes that exact string as the cause, depending on what is idiomatic in the language (it may not be idiomatic to check strings for error messages). - - The [`SCENARIOS.txt`](./SCENARIOS.txt) file contains a set of scenarios. If one or more of these scenarios apply to a test case, they should be included in its `scenarios` field. - - Each test case must have a unique UUID specified in its `"uuid"` key. A UUID can be randomly generated using the [UUID Generator](https://www.uuidgenerator.net/version4). -The `canonical.json` file can be validated against its schema prior to commiting using https://www.jsonschemavalidator.net/ with... +## Validation + +`canonical.json` files can be validated against its schema using https://www.jsonschemavalidator.net/ with... ``` { "$schema": "https://github.com/exercism/problem-specifications/blob/master/canonical-schema.json" From 937dc6f6b3e971197cb3d9326f7c4ec68c338123 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 30 Sep 2020 14:10:58 +0200 Subject: [PATCH 03/13] Format document --- README.md | 69 +++++++++++++++---------------------------------------- 1 file changed, 18 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index b1b57d2a06..e1c4ce5bf2 100644 --- a/README.md +++ b/README.md @@ -28,20 +28,20 @@ exercises/ 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` - standardized test inputs and outputs that can be used to implement the problem +- `description.md` - the basic problem description +- `metadata.yml` - additional information about the problem, such as where it came from +- `canonical-data.json` - standardized test inputs and outputs that can be used to implement the problem ## Exercises -The following must apply to all exercise: +The following applies to all exercise: -- Exercises must contain tests that cover the public interface of the exercise (also thought of as "application tests"). -- Exercises may contain tests that cover the private or lower-level interface of the exercise (sometimes refered to as "library tests"). +- Exercises _must_ contain tests that cover the public interface of the exercise (also thought of as "application tests"). +- Exercises _may_ contain tests that cover the private or lower-level interface of the exercise (sometimes refered to as "library tests"). ## Test Data (canonical-data.json) -This data can be incorporated into test programs manually or extracted by a program. +This data can be incorporated into test programs manually or extracted by a program. - Test cases are immutable, which means that once a test case has been added, it never changes. There are two exceptions: - The `comments` field _can_ be mutated and thus does not require adding a new test case when changing its value. @@ -94,43 +94,8 @@ The file format is described in [canonical-schema.json](./canonical-schema.json) "firstName" : "Alan", "lastName" : "Smithee" } - , "expected" : "ASlmainthee" - } - , { "comments": - [ " Test cases can be arbitrarily grouped with a description " - , " to make organization easier. " - ] - , "description": "Abnormal inputs: numbers" - , "cases": - [ { "uuid" : "f22d7a03-e752-4f14-9231-4eae9f128cef" - , "description": "Foo'ing a number returns nothing" - , "property" : "foo" - , "input" : { - "word" : "42" - } - , "expected" : null - } - , { "uuid" : "8790a635-e8a8-4343-a29f-7da2929b9378" - , "description": "Foo'ing a very big number returns nothing" - , "scenarios" : ["big-ints"] - , "comments" : [ "Making this test case pass requires using BigInts." ] - , "property" : "foo" - , "input" : { - "word" : "28948022309329048855892746252171976962977213799489202546401021394546514198529" - } - , "expected" : null - } - , { "uuid" : "c7b6f24a-553f-475a-8a40-dba854fe1bff" - , "description": "Bar'ing a name with numbers gives an error" - , "property" : "bar" - , "input" : { - "firstName" : "HAL", - "lastName" : "9000" - } - , "expected" : { "error": "You should never bar a number" } - } - ] - } + ] + } ] } ``` @@ -141,20 +106,21 @@ The file format is described in [canonical-schema.json](./canonical-schema.json) - The `scenarios` field can be mutated additively, by adding new scenarios. Existing scenarios must not be changed or removed. Adding new scenarios does therefore does not mean adding a new test case. - Library tests will have a `library-test` scenario added to allow for easy including/excluding of library tests. Application tests won't have their own scenario, as they must be included and should not be filtered on. -## Conventions +## Conventions There are also some conventions that must be followed: - - Descriptions should not simply explain **what** each case is (that is redundant information) but also **why** each case is there. For example, what kinds of implementation mistakes might this case help us find? - - All keys should follow the [lowerCamelCase](http://wiki.c2.com/?LowerCamelCase) convention. - - If the input is valid but there is no result for the input, the value at `"expected"` should be `null`. - - If an error is expected (because the input is invalid, or any other reason), the value at `"expected"` should be an object containing exactly one property, `"error"`, whose value is a string. - - The string should explain why the error would occur. - - A particular track's implementation of the exercise **need not** necessarily check that the error includes that exact string as the cause, depending on what is idiomatic in the language (it may not be idiomatic to check strings for error messages). +- Descriptions should not simply explain **what** each case is (that is redundant information) but also **why** each case is there. For example, what kinds of implementation mistakes might this case help us find? +- All keys should follow the [lowerCamelCase](http://wiki.c2.com/?LowerCamelCase) convention. +- If the input is valid but there is no result for the input, the value at `"expected"` should be `null`. +- If an error is expected (because the input is invalid, or any other reason), the value at `"expected"` should be an object containing exactly one property, `"error"`, whose value is a string. + - The string should explain why the error would occur. + - A particular track's implementation of the exercise **need not** necessarily check that the error includes that exact string as the cause, depending on what is idiomatic in the language (it may not be idiomatic to check strings for error messages). ## Validation `canonical.json` files can be validated against its schema using https://www.jsonschemavalidator.net/ with... + ``` { "$schema": "https://github.com/exercism/problem-specifications/blob/master/canonical-schema.json" @@ -164,6 +130,7 @@ There are also some conventions that must be followed: ## New Exercises Require a Glyph When creating a new exercise the design team needs to be informed so that a new glyph can be created. + - An issue should be opened in [exercism/website-icons](https://github.com/exercism/website-icons/issues) after a PR has been opened in problem-specifications. - This issue should reference the PR in problem-specifications. From c6d82a9c63d803e0c031622106eded6cc669c740 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 30 Sep 2020 14:20:16 +0200 Subject: [PATCH 04/13] Streamline readme --- README.md | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e1c4ce5bf2..988286e2a6 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,11 @@ Shared metadata for Exercism exercises. ## Contributing Guide -Please see the [contributing guide](./CONTRIBUTING.md) +Please see the [contributing guide](./CONTRIBUTING.md). -## Problem metadata +## Exercise Metadata -Each problem's data lives in a directory under `exercises/` +Each exercise's data lives in a directory under `exercises/` . ```text exercises/ @@ -26,29 +26,25 @@ exercises/ └── metadata.yml ``` -There are three metadata files: +There are three metadata files per exercise: - `description.md` - the basic problem description -- `metadata.yml` - additional information about the problem, such as where it came from -- `canonical-data.json` - standardized test inputs and outputs that can be used to implement the problem +- `metadata.yml` - additional information about the exercise, such as where it came from +- `canonical-data.json` (optional) - standardized test inputs and outputs that can be used to implement the exercise -## Exercises +## Test Data (canonical-data.json) -The following applies to all exercise: +Test data can be incorporated into a track's test suites manually or extracted by a program (a.k.a. a _test generator_). - Exercises _must_ contain tests that cover the public interface of the exercise (also thought of as "application tests"). - Exercises _may_ contain tests that cover the private or lower-level interface of the exercise (sometimes refered to as "library tests"). -## Test Data (canonical-data.json) - -This data can be incorporated into test programs manually or extracted by a program. - - Test cases are immutable, which means that once a test case has been added, it never changes. There are two exceptions: - The `comments` field _can_ be mutated and thus does not require adding a new test case when changing its value. - The `scenarios` field _can_ be mutated additively, by adding new scenarios. Existing scenarios must not be changed or removed. Adding new scenarios thus does not require adding a new test case. -- Test cases must all be considered optional, insomuch that a track should determine per test case whether to implement it or not. +- Test cases _must_ all be considered optional, insomuch that a track should determine per test case whether to implement it or not. - Each test case has a [UUID (v4)](https://en.wikipedia.org/wiki/Universally_unique_identifier) to uniquely identify it. -- If tracks automatically generate test suites from test data, they must do that based on an explicit list of test cases to include/exclude. Test cases are to be identified by their UUID, and we'll provide tooling to help keep track of which test cases to include/exclude. +- If tracks automatically generate test suites from test data, they _must_ do that based on an explicit list of test cases to include/exclude. Test cases must be identified by their UUID, and we'll provide tooling to help keep track of which test cases to include/exclude. ## Test Data Format From 9f55ec0ca150d7b07b44668bd099c8f1ccc7f075 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 30 Sep 2020 15:48:24 +0200 Subject: [PATCH 05/13] Add reimplements section --- README.md | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 988286e2a6..08a3cb23d5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Please see the [contributing guide](./CONTRIBUTING.md). ## Exercise Metadata -Each exercise's data lives in a directory under `exercises/` . +Each exercise's metadata lives in a directory under `exercises/` . ```text exercises/ @@ -100,7 +100,42 @@ The file format is described in [canonical-schema.json](./canonical-schema.json) - The `scenarios` field can use one or more of a predefined set of values, which are defined in a [`SCENARIOS.txt`](./SCENARIOS.txt) file. - The `scenarios` field can be mutated additively, by adding new scenarios. Existing scenarios must not be changed or removed. Adding new scenarios does therefore does not mean adding a new test case. -- Library tests will have a `library-test` scenario added to allow for easy including/excluding of library tests. Application tests won't have their own scenario, as they must be included and should not be filtered on. +- Library tests should have a `library-test` scenario added to allow for easy including/excluding of library tests. Application tests won't have their own scenario, as they must be included and should not be filtered on. + +## Changing Tests + +As test cases are immutable, a "bug fix" requires adding a new test case. We'll add metadata to test cases to link a re-implementation of a test case to the re-implemented test case. + +- Re-implemented test cases _must_ have a `reimplements` field which contains the UUID of the test case that was re-implemented. +- Re-implemented test cases _must_ use the `comments` field to explain why a test case was re-implemented (e.g. "Expected value is changed to 2"). +- Track generators _should not_ automatically select the "latest" version of a test case by looking at the "reimplements" hierarchy. We recommend each track to make this a manual action, as the re-implemented test case might actually make less sense for a track. + +This is an example of what a re-implementation looks like: + +```json +[ + { + "uuid": "e46c542b-31fc-4506-bcae-6b62b3268537", + "description": "two times one is two", + "property": "twice", + "input": { + "number": 1 + }, + "expected": 3 + }, + { + "uuid": "82d32c2e-07b5-42d9-9b1c-19af72bae860", + "description": "two times one is two", + "comments": ["Expected value is changed to 2"], + "reimplements": "e46c542b-31fc-4506-bcae-6b62b3268537", + "property": "twice", + "input": { + "number": 1 + }, + "expected": 2 + } +] +``` ## Conventions From cc7395153989b79243723ba7ff3c87fbf4231647 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 1 Oct 2020 09:10:25 +0200 Subject: [PATCH 06/13] Order scenarios by name --- SCENARIOS.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SCENARIOS.txt b/SCENARIOS.txt index 12e0166f75..892d821e96 100644 --- a/SCENARIOS.txt +++ b/SCENARIOS.txt @@ -1,4 +1,4 @@ -floating-point big-integer -unicode +floating-point library-test +unicode From 26c37e4656cf0ab6a8fbf07065e6a253ced56b5a Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 1 Oct 2020 09:10:34 +0200 Subject: [PATCH 07/13] Add scenarios to JSON schema --- canonical-schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canonical-schema.json b/canonical-schema.json index 90675f26fc..a09a021a48 100644 --- a/canonical-schema.json +++ b/canonical-schema.json @@ -116,7 +116,7 @@ "scenario": { "description": "An identifier for a specific scenario (kebab-case)" , "type": "string" - , "pattern": "^[a-z]+(-[a-z]+)*$" + , "enum": ["big-integer", "floating-point", "library-test", "unicode"] }, "scenarios": From f91b71485b5e54a0dba5028ba82820b5eba21691 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 1 Oct 2020 14:37:15 +0200 Subject: [PATCH 08/13] Fix --- README.md | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 08a3cb23d5..ce10dabedb 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,41 @@ The file format is described in [canonical-schema.json](./canonical-schema.json) "firstName" : "Alan", "lastName" : "Smithee" } - ] - } + , "expected" : "ASlmainthee", { "comments": + [ " Test cases can be arbitrarily grouped with a description " + , " to make organization easier. " + ] + , "description": "Abnormal inputs: numbers" + , "cases": + [ { "uuid" : "f22d7a03-e752-4f14-9231-4eae9f128cef" + , "description": "Foo'ing a number returns nothing" + , "property" : "foo" + , "input" : { + "word" : "42" + } + , "expected" : null + } + , { "uuid" : "8790a635-e8a8-4343-a29f-7da2929b9378" + , "description": "Foo'ing a very big number returns nothing" + , "optional" : "big-ints" + , "comments" : [ "Making this test case pass requires using BigInts." ] + , "property" : "foo" + , "input" : { + "word" : "28948022309329048855892746252171976962977213799489202546401021394546514198529" + } + , "expected" : null + } + , { "uuid" : "c7b6f24a-553f-475a-8a40-dba854fe1bff" + , "description": "Bar'ing a name with numbers gives an error" + , "property" : "bar" + , "input" : { + "firstName" : "HAL", + "lastName" : "9000" + } + , "expected" : { "error": "You should never bar a number" } + } + ] + } ] } ``` From d81b8030cb9c4ada6187d6bd9122e98f27cf129c Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 1 Oct 2020 14:37:58 +0200 Subject: [PATCH 09/13] Fix --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ce10dabedb..c601e7389b 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,9 @@ The file format is described in [canonical-schema.json](./canonical-schema.json) "firstName" : "Alan", "lastName" : "Smithee" } - , "expected" : "ASlmainthee", { "comments": + , "expected" : "ASlmainthee", + } + , { "comments": [ " Test cases can be arbitrarily grouped with a description " , " to make organization easier. " ] From 473b7c5469d34d8487041e75dcfaa8eaca980677 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 1 Oct 2020 14:38:08 +0200 Subject: [PATCH 10/13] Fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c601e7389b..4036038ba9 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ The file format is described in [canonical-schema.json](./canonical-schema.json) "firstName" : "Alan", "lastName" : "Smithee" } - , "expected" : "ASlmainthee", + , "expected" : "ASlmainthee" } , { "comments": [ " Test cases can be arbitrarily grouped with a description " From cab3383747a3adcc50f697e4143c59f7b2715cf3 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 1 Oct 2020 14:51:39 +0200 Subject: [PATCH 11/13] Remove whitespace --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 4036038ba9..6937f20913 100644 --- a/README.md +++ b/README.md @@ -93,35 +93,35 @@ The file format is described in [canonical-schema.json](./canonical-schema.json) , "expected" : "ASlmainthee" } , { "comments": - [ " Test cases can be arbitrarily grouped with a description " - , " to make organization easier. " + [ " Test cases can be arbitrarily grouped with a description " + , " to make organization easier. " ] - , "description": "Abnormal inputs: numbers" + , "description": "Abnormal inputs: numbers" , "cases": - [ { "uuid" : "f22d7a03-e752-4f14-9231-4eae9f128cef" - , "description": "Foo'ing a number returns nothing" - , "property" : "foo" + [ { "uuid" : "f22d7a03-e752-4f14-9231-4eae9f128cef" + , "description": "Foo'ing a number returns nothing" + , "property" : "foo" , "input" : { - "word" : "42" + "word" : "42" } , "expected" : null } - , { "uuid" : "8790a635-e8a8-4343-a29f-7da2929b9378" - , "description": "Foo'ing a very big number returns nothing" - , "optional" : "big-ints" + , { "uuid" : "8790a635-e8a8-4343-a29f-7da2929b9378" + , "description": "Foo'ing a very big number returns nothing" + , "optional" : "big-ints" , "comments" : [ "Making this test case pass requires using BigInts." ] - , "property" : "foo" + , "property" : "foo" , "input" : { - "word" : "28948022309329048855892746252171976962977213799489202546401021394546514198529" + "word" : "28948022309329048855892746252171976962977213799489202546401021394546514198529" } , "expected" : null } - , { "uuid" : "c7b6f24a-553f-475a-8a40-dba854fe1bff" - , "description": "Bar'ing a name with numbers gives an error" - , "property" : "bar" + , { "uuid" : "c7b6f24a-553f-475a-8a40-dba854fe1bff" + , "description": "Bar'ing a name with numbers gives an error" + , "property" : "bar" , "input" : { "firstName" : "HAL", - "lastName" : "9000" + "lastName" : "9000" } , "expected" : { "error": "You should never bar a number" } } From 929c3d1460d6a678176d65781dbbaa14c0b44df0 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 1 Oct 2020 15:11:17 +0200 Subject: [PATCH 12/13] Remove whitespace --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 6937f20913..62444aced0 100644 --- a/README.md +++ b/README.md @@ -92,40 +92,40 @@ The file format is described in [canonical-schema.json](./canonical-schema.json) } , "expected" : "ASlmainthee" } - , { "comments": + , { "comments": [ " Test cases can be arbitrarily grouped with a description " , " to make organization easier. " - ] + ] , "description": "Abnormal inputs: numbers" - , "cases": + , "cases": [ { "uuid" : "f22d7a03-e752-4f14-9231-4eae9f128cef" , "description": "Foo'ing a number returns nothing" , "property" : "foo" - , "input" : { + , "input" : { "word" : "42" - } - , "expected" : null - } + } + , "expected" : null + } , { "uuid" : "8790a635-e8a8-4343-a29f-7da2929b9378" , "description": "Foo'ing a very big number returns nothing" , "optional" : "big-ints" - , "comments" : [ "Making this test case pass requires using BigInts." ] + , "comments" : [ "Making this test case pass requires using BigInts." ] , "property" : "foo" - , "input" : { + , "input" : { "word" : "28948022309329048855892746252171976962977213799489202546401021394546514198529" - } - , "expected" : null - } + } + , "expected" : null + } , { "uuid" : "c7b6f24a-553f-475a-8a40-dba854fe1bff" , "description": "Bar'ing a name with numbers gives an error" , "property" : "bar" - , "input" : { - "firstName" : "HAL", + , "input" : { + "firstName" : "HAL", "lastName" : "9000" - } - , "expected" : { "error": "You should never bar a number" } - } - ] + } + , "expected" : { "error": "You should never bar a number" } + } + ] } ] } @@ -189,7 +189,7 @@ There are also some conventions that must be followed: ``` { - "$schema": "https://github.com/exercism/problem-specifications/blob/master/canonical-schema.json" +"$schema": "https://github.com/exercism/problem-specifications/blob/master/canonical-schema.json" } ``` From f7af919deacaf84a99ec8c3601e4b0a7423bf27d Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Fri, 2 Oct 2020 16:29:43 +0200 Subject: [PATCH 13/13] Update README.md Co-authored-by: Victor Goff --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 62444aced0..dd79cd272f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Please see the [contributing guide](./CONTRIBUTING.md). ## Exercise Metadata -Each exercise's metadata lives in a directory under `exercises/` . +Each exercise's metadata lives in a directory under `exercises/`. ```text exercises/