Skip to content

Commit 51c9b0b

Browse files
committed
wordy: Test question What is? because it's too short
wordy 1.5.0 In keeping with [1.3.0][], we want to test that this fails in an expected way rather than an unexpected way. [1.3.0]: #1383 For example, imagine a language that uses an optional as the answer. We would want to make sure an implementation written in that language would return `None`, rather than (say) accessing an out-of-bounds index due to always assuming that the inputs will have at least three space-separated elements (of the form "What is X...?").
1 parent ed9cf2e commit 51c9b0b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

exercises/wordy/canonical-data.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"exercise": "wordy",
3-
"version": "1.4.1",
3+
"version": "1.5.0",
44
"comments": [
55
"The tests that expect an 'error' should be implemented to raise",
66
"an error, or indicate a failure. Implement this in a way that",
@@ -151,6 +151,14 @@
151151
},
152152
"expected": {"error": "syntax error"}
153153
},
154+
{
155+
"description": "reject problem with no operands or operators",
156+
"property": "answer",
157+
"input": {
158+
"question": "What is?"
159+
},
160+
"expected": {"error": "syntax error"}
161+
},
154162
{
155163
"description": "reject two operations in a row",
156164
"property": "answer",

0 commit comments

Comments
 (0)