Skip to content

forth: Add new tests from x-common#413

Merged
petertseng merged 3 commits intoexercism:masterfrom
petertseng:forth2
Nov 7, 2016
Merged

forth: Add new tests from x-common#413
petertseng merged 3 commits intoexercism:masterfrom
petertseng:forth2

Conversation

@petertseng
Copy link
Copy Markdown
Member

First commit is same as #412, the rest should bring us to match exercism/problem-specifications#394

Copy link
Copy Markdown
Contributor

@rbasso rbasso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems fine here!

I didn't check if the content of each of the tests is correct, but I bet they are. 😁

I guess it will have to be rebased.

runTexts ["swap" ] `shouldBe` Left StackUnderflow
it "errors if there is only one value on the stack" $
runTexts ["1 swap" ] `shouldBe` Left StackUnderflow

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that here you swapped to order of those two test. I like the new ordering more. 👍

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I was inconsistent. 1 over is before over. I'll make it consistent, and note an order change in commit message.

Comment thread exercises/forth/test/Tests.hs Outdated
it "copies the second element if there are more than two" $
runTexts ["1 2 3 over"] `shouldBe` Right [1, 2, 3, 2]
it "errors if there is nothing on the stack" $
runTexts ["1 over" ] `shouldBe` Left StackUnderflow
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually it's even worse - the test message doesn't match the actual test!!!

Just as exercism/problem-specifications#394 has it.

Most test lines should look clean under `git diff -w` ignoring
whitespace since they were simply indented.

EXCEPTIONS:

swap/over tests have changed ordering: The "nothing on stack" tests now
come before the "one value on the stack" tests.

The divide by zero test is now a simple `4 0 /` rather than `4 2 2 - /`
to be more straightforward.
It is separated from the combined arithmetic tests, in anticipate of
more dedicated division tests coming soon.
These are tests for each of the individual arithmetic operators, and one
for making sure user-defined words execute in the right order.
@petertseng
Copy link
Copy Markdown
Member Author

Everything should be OK now - the only change is to rebase and also to fix the ordering of the over tests. I'll take a final look.

@petertseng petertseng merged commit 61d8d1b into exercism:master Nov 7, 2016
@petertseng petertseng deleted the forth2 branch November 7, 2016 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants