diff --git a/exercises/forth/canonical-data.json b/exercises/forth/canonical-data.json index 66ee851575..68c188c781 100644 --- a/exercises/forth/canonical-data.json +++ b/exercises/forth/canonical-data.json @@ -1,10 +1,10 @@ { "exercise": "forth", - "version": "1.6.0", + "version": "1.7.0", "comments": [ "The cases are split into multiple sections, all with the same structure.", "In all cases, the `expected` key is the resulting stack", - "after executing the Forth program contained in the `input` key." + "after executing the Forth program contained in the `input` key, unless an 'error' exists." ], "cases": [ { @@ -37,7 +37,7 @@ "input": { "instructions": ["+"] }, - "expected": null + "expected": {"error": "empty stack"} }, { "description": "errors if there is only one value on the stack", @@ -45,7 +45,7 @@ "input": { "instructions": ["1 +"] }, - "expected": null + "expected": {"error": "only one value on stack"} } ] }, @@ -66,7 +66,7 @@ "input": { "instructions": ["-"] }, - "expected": null + "expected": {"error": "empty stack"} }, { "description": "errors if there is only one value on the stack", @@ -74,7 +74,7 @@ "input": { "instructions": ["1 -"] }, - "expected": null + "expected": {"error": "only one value on the stack"} } ] }, @@ -95,7 +95,7 @@ "input": { "instructions": ["*"] }, - "expected": null + "expected": {"error": "empty stack"} }, { "description": "errors if there is only one value on the stack", @@ -103,7 +103,7 @@ "input": { "instructions": ["1 *"] }, - "expected": null + "expected": {"error": "only one value on the stack"} } ] }, @@ -132,7 +132,7 @@ "input": { "instructions": ["4 0 /"] }, - "expected": null + "expected": {"error": "divide by zero"} }, { "description": "errors if there is nothing on the stack", @@ -140,7 +140,7 @@ "input": { "instructions": ["/"] }, - "expected": null + "expected": {"error": "empty stack"} }, { "description": "errors if there is only one value on the stack", @@ -148,7 +148,7 @@ "input": { "instructions": ["1 /"] }, - "expected": null + "expected": {"error": "only one value on the stack"} } ] }, @@ -198,7 +198,7 @@ "input": { "instructions": ["dup"] }, - "expected": null + "expected": {"error": "empty stack"} } ] }, @@ -227,7 +227,7 @@ "input": { "instructions": ["drop"] }, - "expected": null + "expected": {"error": "empty stack"} } ] }, @@ -256,7 +256,7 @@ "input": { "instructions": ["swap"] }, - "expected": null + "expected": {"error": "empty stack"} }, { "description": "errors if there is only one value on the stack", @@ -264,7 +264,7 @@ "input": { "instructions": ["1 swap"] }, - "expected": null + "expected": {"error": "only one value on the stack"} } ] }, @@ -293,7 +293,7 @@ "input": { "instructions": ["over"] }, - "expected": null + "expected": {"error": "empty stack"} }, { "description": "errors if there is only one value on the stack", @@ -301,7 +301,7 @@ "input": { "instructions": ["1 over"] }, - "expected": null + "expected": {"error": "only one value on the stack stack"} } ] }, @@ -395,7 +395,7 @@ "input": { "instructions": [": 1 2 ;"] }, - "expected": null + "expected": {"error": "illegal operation"} }, { "description": "errors if executing a non-existent word", @@ -403,7 +403,7 @@ "input": { "instructions": ["foo"] }, - "expected": null + "expected": {"error": "undefined operation"} } ] }, diff --git a/exercises/phone-number/canonical-data.json b/exercises/phone-number/canonical-data.json index fbfb151ed1..2349b14f99 100644 --- a/exercises/phone-number/canonical-data.json +++ b/exercises/phone-number/canonical-data.json @@ -1,12 +1,12 @@ { "exercise": "phone-number", - "version": "1.5.0", + "version": "1.6.0", "cases": [ { "description": "Cleanup user-entered phone numbers", "comments": [ " Returns the cleaned phone number if given number is valid, " - , " else returns nil. Note that number is not formatted, " + , " else returns error object. Note that number is not formatted," , " just a 10-digit number is returned. " ], "cases": [ @@ -40,7 +40,7 @@ "input": { "phrase": "123456789" }, - "expected": null + "expected": {"error": "incorrect number of digits"} }, { "description": "invalid when 11 digits does not start with a 1", @@ -48,7 +48,7 @@ "input": { "phrase": "22234567890" }, - "expected": null + "expected": {"error": "11 digits must start with 1"} }, { "description": "valid when 11 digits and starting with 1", @@ -72,7 +72,7 @@ "input": { "phrase": "321234567890" }, - "expected": null + "expected": {"error": "more than 11 digits"} }, { "description": "invalid with letters", @@ -80,7 +80,7 @@ "input": { "phrase": "123-abc-7890" }, - "expected": null + "expected": {"error": "alphanumerics not permitted"} }, { "description": "invalid with punctuations", @@ -88,7 +88,7 @@ "input": { "phrase": "123-@:!-7890" }, - "expected": null + "expected": {"error": "punctuations not permitted"} }, { "description": "invalid if area code starts with 0", @@ -96,7 +96,7 @@ "input": { "phrase": "(023) 456-7890" }, - "expected": null + "expected": {"error": "area code cannot start with zero"} }, { "description": "invalid if area code starts with 1", @@ -104,7 +104,7 @@ "input": { "phrase": "(123) 456-7890" }, - "expected": null + "expected": {"error": "area code cannot start with one"} }, { "description": "invalid if exchange code starts with 0", @@ -112,7 +112,7 @@ "input": { "phrase": "(223) 056-7890" }, - "expected": null + "expected": {"error": "exchange cannot start with zero"} }, { "description": "invalid if exchange code starts with 1", @@ -120,7 +120,7 @@ "input": { "phrase": "(223) 156-7890" }, - "expected": null + "expected": {"error": "exchange cannot start with one"} }, { "description": "invalid if area code starts with 0 on valid 11-digit number", @@ -128,7 +128,7 @@ "input": { "phrase": "1 (023) 456-7890" }, - "expected": null + "expected": {"error": "area code cannot start with zero"} }, { "description": "invalid if area code starts with 1 on valid 11-digit number", @@ -136,7 +136,7 @@ "input": { "phrase": "1 (123) 456-7890" }, - "expected": null + "expected": {"error": "area code cannot start with one"} }, { "description": "invalid if exchange code starts with 0 on valid 11-digit number", @@ -144,7 +144,7 @@ "input": { "phrase": "1 (223) 056-7890" }, - "expected": null + "expected": {"error": "exchange code cannot start with zero"} }, { "description": "invalid if exchange code starts with 1 on valid 11-digit number", @@ -152,7 +152,7 @@ "input": { "phrase": "1 (223) 156-7890" }, - "expected": null + "expected": {"error": "exchange code cannot start with one"} } ] } diff --git a/exercises/queen-attack/canonical-data.json b/exercises/queen-attack/canonical-data.json index af6127c516..f5ad9a95c6 100644 --- a/exercises/queen-attack/canonical-data.json +++ b/exercises/queen-attack/canonical-data.json @@ -1,9 +1,9 @@ { "exercise": "queen-attack", - "version": "2.1.0", + "version": "2.2.0", "comments": [ "Testing invalid positions will vary by language. The expected", - "value of -1 is there to indicate some sort of failure should", + "value of 'error' is there to indicate some sort of failure should", "occur, while a 0 means no failure.", "Some languages implement tests beyond this set, such as checking", "for two pieces being placed on the same position, representing", @@ -38,7 +38,7 @@ } } }, - "expected": -1 + "expected": {"error": "row not positive"} }, { "description": "queen must have row on board", @@ -51,7 +51,7 @@ } } }, - "expected": -1 + "expected": {"error": "row not on board"} }, { "description": "queen must have positive column", @@ -64,7 +64,7 @@ } } }, - "expected": -1 + "expected": {"error": "column not positive"} }, { "description": "queen must have column on board", @@ -77,7 +77,7 @@ } } }, - "expected": -1 + "expected": {"error": "column not on board"} } ] }, diff --git a/exercises/say/canonical-data.json b/exercises/say/canonical-data.json index 004f755aa9..0f46c30cda 100644 --- a/exercises/say/canonical-data.json +++ b/exercises/say/canonical-data.json @@ -1,8 +1,8 @@ { "exercise": "say", - "version": "1.1.0", + "version": "1.2.0", "comments": [ - "Here -1 is used as expected value to indicate that the", + "An 'error' object is used as expected value to indicate that the", "input value is out of the range described in the exercise." ], "cases": [ @@ -116,7 +116,7 @@ "input": { "number": -1 }, - "expected": -1 + "expected": {"error": "input out of range"} }, { "description": "numbers above 999,999,999,999 are out of range", @@ -124,7 +124,7 @@ "input": { "number": 1000000000000 }, - "expected": -1 + "expected": {"error": "input out of range"} } ] } \ No newline at end of file diff --git a/exercises/variable-length-quantity/canonical-data.json b/exercises/variable-length-quantity/canonical-data.json index c48159b6f8..7fdc4806e2 100644 --- a/exercises/variable-length-quantity/canonical-data.json +++ b/exercises/variable-length-quantity/canonical-data.json @@ -1,9 +1,10 @@ { "exercise": "variable-length-quantity", - "version": "1.1.0", + "version": "1.2.0", "comments": [ "JSON doesn't allow hexadecimal literals.", "All numbers are given as decimal literals instead.", + "An error should be expected for incomplete sequences.", "It is highly recommended that your track's test generator display all numbers as hexadecimal literals." ], "cases": [ @@ -205,7 +206,7 @@ "input": { "integers": [255] }, - "expected": null + "expected": {"error": "incomplete sequence"} }, { "description": "incomplete sequence causes error, even if value is zero", @@ -213,7 +214,7 @@ "input": { "integers": [128] }, - "expected": null + "expected": {"error": "incomplete sequence"} }, { "description": "multiple values",