From 7628850d0d347b64b4f6f10a16261ed3cf8276a3 Mon Sep 17 00:00:00 2001 From: Cedd Burge Date: Fri, 3 Mar 2023 12:01:38 +0000 Subject: [PATCH 1/2] Improve error classification --- exercises/wordy/canonical-data.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/wordy/canonical-data.json b/exercises/wordy/canonical-data.json index 06f296acc1..e264cd4023 100644 --- a/exercises/wordy/canonical-data.json +++ b/exercises/wordy/canonical-data.json @@ -160,7 +160,7 @@ "question": "Who is the President of the United States?" }, "expected": { - "error": "unknown operation" + "error": "syntax error" } }, { @@ -204,7 +204,7 @@ "question": "What is 1 plus 2 1?" }, "expected": { - "error": "syntax error" + "error": "unknown operation" } }, { @@ -215,7 +215,7 @@ "question": "What is 1 2 plus?" }, "expected": { - "error": "syntax error" + "error": "unknown operation" } }, { @@ -226,7 +226,7 @@ "question": "What is plus 1 2?" }, "expected": { - "error": "syntax error" + "error": "unknown operation" } } ] From e31f7d9729263a56f51d7faa901441c87c7d227d Mon Sep 17 00:00:00 2001 From: Cedd Burge Date: Fri, 3 Mar 2023 15:38:11 +0000 Subject: [PATCH 2/2] Reimplement tests instead of modifying them --- exercises/wordy/canonical-data.json | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/exercises/wordy/canonical-data.json b/exercises/wordy/canonical-data.json index e264cd4023..b5558dbe56 100644 --- a/exercises/wordy/canonical-data.json +++ b/exercises/wordy/canonical-data.json @@ -159,6 +159,18 @@ "input": { "question": "Who is the President of the United States?" }, + "expected": { + "error": "unknown operation" + } + }, + { + "uuid": "deb10580-72dc-477c-80ac-ce27919be913", + "reimplements": "8a7e85a8-9e7b-4d46-868f-6d759f4648f8", + "description": "Non math question", + "property": "answer", + "input": { + "question": "Who is the President of the United States?" + }, "expected": { "error": "syntax error" } @@ -203,6 +215,18 @@ "input": { "question": "What is 1 plus 2 1?" }, + "expected": { + "error": "syntax error" + } + }, + { + "uuid": "a3d198ba-b0f2-409e-80a9-a500c3859aad", + "reimplements": "6abd7a50-75b4-4665-aa33-2030fd08bab1", + "description": "reject two numbers in a row", + "property": "answer", + "input": { + "question": "What is 1 plus 2 1?" + }, "expected": { "error": "unknown operation" } @@ -214,6 +238,18 @@ "input": { "question": "What is 1 2 plus?" }, + "expected": { + "error": "syntax error" + } + }, + { + "uuid": "824b9f29-5bed-402d-b09f-a55aeb264f7c", + "reimplements": "10a56c22-e0aa-405f-b1d2-c642d9c4c9de", + "description": "reject postfix notation", + "property": "answer", + "input": { + "question": "What is 1 2 plus?" + }, "expected": { "error": "unknown operation" } @@ -225,6 +261,18 @@ "input": { "question": "What is plus 1 2?" }, + "expected": { + "error": "syntax error" + } + }, + { + "uuid": "1ab7e9ba-4dbf-4bfc-b81d-8a7e2ea4e86a", + "reimplements": "0035bc63-ac43-4bb5-ad6d-e8651b7d954e", + "description": "reject prefix notation", + "property": "answer", + "input": { + "question": "What is plus 1 2?" + }, "expected": { "error": "unknown operation" }