-
-
Notifications
You must be signed in to change notification settings - Fork 195
crypto-square: Rewrite tests to use hspec with fail-fast. #249
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
Conversation
- Rewrite tests to use hspec. - Remove old tests. - Add tests to match `x-common`. - Remove function `squareSize` from the test suite. - Remove function `squareSize` from the stub solution. - Remove function `squareSize` from example's export list.
normalizeCiphertext "This is fun!" | ||
`shouldBe` "tsf hiu isn" | ||
|
||
{- In this track the encoded text chunks are not padded with spaces. |
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.
do you think they should be?
I realize it would probably make the example implementation a bit more complex
To make it clear, I don't care enough to insist on one way or the other
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.
Should we instead keep the old test that expects imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
?
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 that this exercise is not very idiomatic and deserves a major rewrite, with better functions name and, maybe, using lists of strings. But for now, I am just trying to document the differences between the track and x-common.
I'm against that last test. The multiple spaces between the words make sense only if we look at the string as a matrix - and this is probably the reason why there is space padding in the exercise - but in Haskell we would never represent a matrix as a single string.
What do you think? Should we enforce non-padding (old test), padding (json) or accept both (PR)?
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.
Given that you have plans pending, I'm fine with leaving this commented as it already is. The student can uncomment it if truly desired, and there is a test for the perfect square case above. As long as there is a note in either #194 or a new issue describing the change planned!
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.
Issue opened! Thanks again, @petertseng!
I know it is probably boring to review so many similar Hspec PRs, but we almost there. 😄
As long as there is a note in either #194 or a new issue describing the change planned!
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 know it is probably boring to review so many similar Hspec PRs, but we almost there.
I think to be commended more is your persistence in doing all of them, actually!
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 had a lot of fun rewriting the first 10 exercises... 😁
x-common
.squareSize
from the test suite.squareSize
from the stub solution.squareSize
from example's export list.Related to #211.