Atbash-cipher: Are the last two tests invalid?

Apologies if this has been mentioned before, or if I’m missing something obvious.

As I was trying to do the usual sync in the Clojure track, I noticed that the last two tests in the problem specs use ciphertexts that cannot be valid encoded messages:

  • ‘vc vix r hn’
  • ‘zmlyhgzxovrhlugvmzhgvkkrmthglmv’

According to the instructions, the encoded text should have a space every 5 characters, but neither of the above strings meets this rule.

So, is there any particular reason for using these strings?

Someone decided it is worth testing inputs with invalid spacing and multiple maintainers signed off on that. Unless there is a really good reason to do so, I would suggest not reversing that prior decision.

So, one person suggested it, and another approved it, but no explanation was provided at the time (6 years ago).

The specs state on line 6:

Decoding from atbash cipher to all-lowercase-mashed-together English.

Using test cases with strings that are not valid Atbash cipher seems to contradict this. As a result, the two test cases do not align with the intended specifications. They are, in fact, invalid.

As long as we do not replace the invalid tests with a test to prevent invalid input, all existing solutions will still pass the rest of the tests. So I’m for removing those tests.

1 Like