Skip to content

simple-cipher: test that messages longer than the key can be decoded#1460

Merged
rpottsoh merged 1 commit intoexercism:masterfrom
paparomeo:simple-cipher-test-decode-message-longer-than-key
Feb 14, 2019
Merged

simple-cipher: test that messages longer than the key can be decoded#1460
rpottsoh merged 1 commit intoexercism:masterfrom
paparomeo:simple-cipher-test-decode-message-longer-than-key

Conversation

@paparomeo
Copy link
Copy Markdown
Contributor

I just come across a solution for the "Simple Cipher" exercise from a student, which could encode messages longer than the key but failed to decode messages longer than the key, and yet, because we haven't a test to cover this, all tests would pass giving an illusion of correctness.

This pull request adds a test to also check that a message longer than the key can be decoded.

Copy link
Copy Markdown
Member

@rpottsoh rpottsoh left a comment

Choose a reason for hiding this comment

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

@paparomeo thanks for taking the time to propose these changes. At a quick glance the added test case seems reasonable. I just have a couple of items that should be addressed that I have indicated. This PR will remain open for a few days, at least, to allow time for other people to have an opportunity to chime in.

Comment thread exercises/simple-cipher/canonical-data.json Outdated
Comment thread exercises/simple-cipher/canonical-data.json Outdated
@paparomeo paparomeo force-pushed the simple-cipher-test-decode-message-longer-than-key branch from a73f4a9 to e33df06 Compare February 13, 2019 04:39
@paparomeo paparomeo force-pushed the simple-cipher-test-decode-message-longer-than-key branch from e33df06 to d91b3cc Compare February 13, 2019 04:45
@paparomeo
Copy link
Copy Markdown
Contributor Author

All request changes now pushed @rpottsoh. Thank you for the quick feedback!

@paparomeo paparomeo changed the title simple-cipher: test that messages longer than the key can be decoded. simple-cipher: test that messages longer than the key can be decoded Feb 13, 2019
Copy link
Copy Markdown
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

Excellent addition!

Copy link
Copy Markdown
Member

@SleeplessByte SleeplessByte left a comment

Choose a reason for hiding this comment

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

LGTM. @paparomeo when this has been merged, can you ping me in the JS pr so we can get that merged?

@paparomeo
Copy link
Copy Markdown
Contributor Author

Will do @SleeplessByte!

@rpottsoh
Copy link
Copy Markdown
Member

We have three approvals. I am going to go ahead and merge this. Thanks for working on this @paparomeo and making this exercise better!

@rpottsoh rpottsoh merged commit ed2fecd into exercism:master Feb 14, 2019
"property": "decode",
"input": {
"key": "abc",
"plaintext": "iboaqcnecbfcr"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I highly recommend that this has to be ciphertext, like all the other decode cases in this file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huh, yeah, that slipped by. I agree should be ciphertext. I think this would also constitute a major version change as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Apologies. Missed that one too (the evils of copy+paste!). I'll submit a PR changing to ciphertext. I'll bump the version to major also.

@paparomeo
Copy link
Copy Markdown
Contributor Author

#1462 submitted with property name fix and major version bump as suggested by @rpottsoh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants