-
-
Notifications
You must be signed in to change notification settings - Fork 550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wordy: Test question What is?
because it's too short
#1401
Conversation
exercises/wordy/canonical-data.json
Outdated
"expected": {"error": "syntax error"} | ||
}, | ||
{ | ||
"description": "reject empty string", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test perhaps unnecessary because of #902?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of me wants to say "but then who will guard against people assuming that the input is always at least two words!" but I guess part of the question is what assumptions we're at liberty to make. Here's my deal. I'm going to leave that case for later. If there's a desire to add it, it'll be in 1.6.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we need a case that asks a valid question but doesn't start with "What is". "What is" shouldn't influence the outcome.
5 plus 6 is?
should work the same as:
What is 6 plus 5?
and
6 plus 2 plus 3?
For another PR perhaps......
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These proposals, along with the empty string, do bring up interesting questions of how far we want to take the parsing aspect in this problem.
The arithmetic portion is not too complicated, but does bring up interesting questions of how to translate each operation from its verbal form to its code form. So there could be some room to do more parsing.
I have not yet decided what I would suggest in this realm.
What is?
and empty string)What is?
because it's too short
exercises/wordy/canonical-data.json
Outdated
@@ -151,6 +151,14 @@ | |||
}, | |||
"expected": {"error": "syntax error"} | |||
}, | |||
{ | |||
"description": "reject unstarted problem", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this unstarted or unfinished?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I call it unfinished, I worry that the description sounds too similar to incomplete problem
above (since I see unfinished
and incomplete
to have too similar meanings).
If we take for granted that "What is" is a common feature of all questions, then I see it making sense since they didn't even start saying anything else
But if this assumption gets broken in a later PR that adds questions that don't start with "What is", then this description won't make sense!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps ambiguous
instead of unfinished
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the way out will be to say exactly in what way the two problems are incomplete. I have now made a proposal.
I will be adding another case soon that has a problem that is incomplete in a different way
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...?").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! Thanks @petertseng.
All right, thanks! Everyone else I'd say you have about 24 hours to get a word in. |
…#779) 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]: exercism/problem-specifications#1383 Specifically for Haskell, we want to make sure that this results in `None` rather than 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...?"). exercism/problem-specifications#1401
…764) 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]: exercism/problem-specifications#1383 Specifically for Rust, we want to make sure that this results in `None` rather than 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...?"). exercism/problem-specifications#1401
wordy 1.5.0
In keeping with 1.3.0, we want to test that these fail in an
expected way rather than an unexpected way.
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 toalways assuming that the inputs will have at least three space-separated
elements (of the form "What is X...?").