simple-cipher: add test to check that messages longer than the key can be decoded.#611
Conversation
| }); | ||
|
|
||
| xtest('can decode messages longer than the key', () => { | ||
| expect(new Cipher('abc').encode('iboaqcnecbfcr')) |
There was a problem hiding this comment.
I think you're trying to decode this.
| expect(new Cipher('abc').encode('iboaqcnecbfcr')) | |
| expect(new Cipher('abc').decode('iboaqcnecbfcr')) |
|
Actually, looking at the canonical data, you probably took it from there: {
"description": "Can handle messages longer than the key",
"property": "encode",
"input": {
"key": "abc",
"plaintext": "iamapandabear"
},
"expected": "iboaqcnecbfcr"
}This expects a plaintext of `"iamapandabear" and expected value of "iboaqcnecbfcr" after encode. |
|
Silly me. Copy / paste error... 🤦♂️. I'll fix as soon as I get home (the invoked method should be |
e002513 to
9eb5acd
Compare
9eb5acd to
f227715
Compare
|
@SleeplessByte: Fixed! Correspondent problem specifications PR: exercism/problem-specifications#1460. |
|
exercism/problem-specifications#1460 has been merged @SleeplessByte. |
|
You're the best @paparomeo |
|
This was bugging me all the time when mentoring. As I came around to addressing this here I found it was fixed already. Many thanks! |
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.
Correspondent problem specifications PR: exercism/problem-specifications#1460.