-
-
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
forth: Remove test for empty input #976
Conversation
This requirement does not seem to be mentioned in the description which seem to be otherwise explicit about which commands should be supported. |
@Insti, I'm not quite sure that I understand your point - I wouldn't consider an empty command to really be a command, but I would expect any parser to be able to handle them gracefully, particularly when empty lines have no effect in Forth. My reasoning was that interpreters (eg. |
I agree with you that a well behaved parser should ignore blank lines. A solution that matches the described requirements may or may not handle blank lines gracefully, but its exact behaviour is undefined in the description and irrelevant to the rest of the exercise. If you wish to add an additional test for this in a particular track, that is fine. See also: #902 |
If the description does not change: Would it therefore be appropriate to remove the test of |
@Insti, thanks for your clarification. If we are going to continue to test for Also, I noticed that the canonical data currently doesn't test for case insensitivity, despite it being an explicit part of the problem description. I'm happy to add these tests, but do you think that they would be better as part of this PR (with a suitable name change), or should they go into a different PR? |
That sounds sensible.
I'd recommend making a new PR. There is no shortage of available pull requests. |
Editing the original post here with an update would be good. |
Thanks for reminding me, @Insti - I forgot about the description! |
From a TDD perspective, the first (empty list) function requires you to write a function with the desired type and name, but nothing else. The next test is a bit more complicated. Nothing in the descriotion mentions parsing an empty string, and it may add additional difficulty. So I'd be in favour of leaving the tests as is. |
This is an implementation detail and not something that is required to verify that the solution is correct, so does not belong in the canonical data. Students are encouraged to write their own TDD tests and I would hope by the time they got to an exercise implementing a FORTH interpreter that they would be able to do this. Therefore removing this test from the canonical data is the right thing to do. |
I agree. |
Thanks @N-Parsons ❤️ |
exercism/problem-specifications#976 It is not necessary to verify that the implementation matches the specification, since the specification does not define behaviour of empty inputs.
This PR adds a new test designed to check that an empty line (represented by an empty string) is handled/ignored and leaves the stack empty without failing.This PR removed the test for empty input
[]
in line with the discussion below. This test was considered to be unexpected for the current problem description.