diff --git a/exercises/practice/crypto-square/.meta/tests.toml b/exercises/practice/crypto-square/.meta/tests.toml index dd83eafb..94ef0819 100644 --- a/exercises/practice/crypto-square/.meta/tests.toml +++ b/exercises/practice/crypto-square/.meta/tests.toml @@ -12,6 +12,9 @@ [407c3837-9aa7-4111-ab63-ec54b58e8e9f] description = "empty plaintext results in an empty ciphertext" +[aad04a25-b8bb-4304-888b-581bea8e0040] +description = "normalization results in empty plaintext" + [64131d65-6fd9-4f58-bdd8-4a2370fb481d] description = "Lowercase" @@ -29,3 +32,8 @@ description = "8 character plaintext results in 3 chunks, the last one with a tr [fbcb0c6d-4c39-4a31-83f6-c473baa6af80] description = "54 character plaintext results in 7 chunks, the last two with trailing spaces" +include = false + +[33fd914e-fa44-445b-8f38-ff8fbc9fe6e6] +description = "54 character plaintext results in 8 chunks, the last two with trailing spaces" +reimplements = "fbcb0c6d-4c39-4a31-83f6-c473baa6af80" diff --git a/exercises/practice/crypto-square/source/crypto_square.d b/exercises/practice/crypto-square/source/crypto_square.d index 910ba177..b9f51b43 100644 --- a/exercises/practice/crypto-square/source/crypto_square.d +++ b/exercises/practice/crypto-square/source/crypto_square.d @@ -12,6 +12,12 @@ unittest static if (allTestsEnabled) { + // normalize_to_empty + { + auto theCipher = new Cipher("... --- ..."); + assert("" == theCipher.normalizePlainText()); + } + // normalize_numbers { auto theCipher = new Cipher("1, 2, 3 GO!"); @@ -85,6 +91,12 @@ unittest auto theCipher = new Cipher("Vampires are people too!"); assert("vrel aepe mset paoo irpo" == theCipher.normalize.cipherText()); } + + // normalized_Cipher_text3 + { + auto theCipher = new Cipher("If man was meant to stay on the ground, god would have given us roots."); + assert("imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau" == theCipher.normalize.cipherText()); + } } }