Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions exercises/practice/crypto-square/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"
12 changes: 12 additions & 0 deletions exercises/practice/crypto-square/source/crypto_square.d
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
Expand Down Expand Up @@ -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());
}
}

}