Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto-square: Fix formatting of test code #844

Closed
Closed
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
20 changes: 7 additions & 13 deletions exercises/practice/crypto-square/crypto_square_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
#include "test/catch.hpp"
#endif

TEST_CASE("empty plaintext results in an empty ciphertext",
"[407c3837-9aa7-4111-ab63-ec54b58e8e9f]") {
TEST_CASE("empty plaintext results in an empty ciphertext", "[407c3837-9aa7-4111-ab63-ec54b58e8e9f]") {
REQUIRE("" == crypto_square::cipher("").normalized_cipher_text());
}

#if defined(EXERCISM_RUN_ALL_TESTS)
TEST_CASE("normalization results in empty plaintext",
"[aad04a25-b8bb-4304-888b-581bea8e0040]") {
TEST_CASE("normalization results in empty plaintext", "[aad04a25-b8bb-4304-888b-581bea8e0040]") {
REQUIRE("" ==
crypto_square::cipher("... --- ...").normalized_cipher_text());
}
Expand All @@ -35,22 +33,18 @@ TEST_CASE("9 character plaintext results in 3 chunks of 3 characters",
crypto_square::cipher("This is fun!").normalized_cipher_text());
}

TEST_CASE(
// clang-format off
"8 character plaintext results in 3 chunks, the last one with a trailing space",
// clang-format on
"[a65d3fa1-9e09-43f9-bcec-7a672aec3eae]") {
// clang-format off
TEST_CASE("8 character plaintext results in 3 chunks, the last one with a trailing space", "[a65d3fa1-9e09-43f9-bcec-7a672aec3eae]") {
REQUIRE("clu hlt io " ==
crypto_square::cipher("Chill out.").normalized_cipher_text());
}

TEST_CASE(
"54 character plaintext results in 7 chunks, the last two with trailing "
"spaces",
"[fbcb0c6d-4c39-4a31-83f6-c473baa6af80]") {
TEST_CASE("54 character plaintext results in 7 chunks, the last two with trailing spaces", "[fbcb0c6d-4c39-4a31-83f6-c473baa6af80]") {
REQUIRE("imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau " ==
crypto_square::cipher("If man was meant to stay on the ground, god "
"would have given us roots.")
.normalized_cipher_text());
}
// clang-format on

#endif