From 06671f7aecfca4730883d70b2037d2aadf5a903b Mon Sep 17 00:00:00 2001 From: Nick Holden Date: Mon, 9 Oct 2017 12:54:13 -0700 Subject: [PATCH 1/4] Remove unneeded sub-group of test cases --- exercises/crypto-square/canonical-data.json | 76 +++++++++------------ 1 file changed, 33 insertions(+), 43 deletions(-) diff --git a/exercises/crypto-square/canonical-data.json b/exercises/crypto-square/canonical-data.json index 8c8e47aa0d..f41eac1d89 100644 --- a/exercises/crypto-square/canonical-data.json +++ b/exercises/crypto-square/canonical-data.json @@ -1,52 +1,42 @@ { "exercise": "crypto-square", - "version": "3.0.0", + "version": "3.1.0", "cases": [ { - "description": "the spaces and punctuation are removed from the English text and the message is downcased", - "cases": [ - { - "description": "Lowercase", - "property": "ciphertext", - "plaintext": "A", - "expected": "a" - }, - { - "description": "Remove spaces", - "property": "ciphertext", - "plaintext": " b ", - "expected": "b" - }, - { - "description": "Remove punctuation", - "property": "ciphertext", - "plaintext": "@1,%!", - "expected": "1" - } - ] + "description": "Lowercase", + "property": "ciphertext", + "plaintext": "A", + "expected": "a" }, { - "description": "Output the encoded text in chunks. Phrases that fill perfect squares `(r X r)` should be output in `r`-length chunks separated by spaces. Imperfect squares will have `n` empty spaces. Those spaces should be distributed evenly across the last `n` rows.", - "cases": [ - { - "description": "empty plaintext results in an empty ciphertext", - "property": "ciphertext", - "plaintext": "", - "expected": "" - }, - { - "description": "9 character plaintext results in 3 chunks of 3 characters", - "property": "ciphertext", - "plaintext": "This is fun!", - "expected": "tsf hiu isn" - }, - { - "description": "54 character plaintext results in 7 chunks, the last two padded with spaces", - "property": "ciphertext", - "plaintext": "If man was meant to stay on the ground, god would have given us roots.", - "expected": "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau " - } - ] + "description": "Remove spaces", + "property": "ciphertext", + "plaintext": " b ", + "expected": "b" + }, + { + "description": "Remove punctuation", + "property": "ciphertext", + "plaintext": "@1,%!", + "expected": "1" + }, + { + "description": "empty plaintext results in an empty ciphertext", + "property": "ciphertext", + "plaintext": "", + "expected": "" + }, + { + "description": "9 character plaintext results in 3 chunks of 3 characters", + "property": "ciphertext", + "plaintext": "This is fun!", + "expected": "tsf hiu isn" + }, + { + "description": "54 character plaintext results in 7 chunks, the last two padded with spaces", + "property": "ciphertext", + "plaintext": "If man was meant to stay on the ground, god would have given us roots.", + "expected": "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau " } ] } From 45725a06aab93592b432d6f096a465b78307ea07 Mon Sep 17 00:00:00 2001 From: Nick Holden Date: Mon, 9 Oct 2017 12:55:06 -0700 Subject: [PATCH 2/4] Reorder test cases to improve TDD experience --- exercises/crypto-square/canonical-data.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/exercises/crypto-square/canonical-data.json b/exercises/crypto-square/canonical-data.json index f41eac1d89..14e5b5c357 100644 --- a/exercises/crypto-square/canonical-data.json +++ b/exercises/crypto-square/canonical-data.json @@ -2,6 +2,12 @@ "exercise": "crypto-square", "version": "3.1.0", "cases": [ + { + "description": "empty plaintext results in an empty ciphertext", + "property": "ciphertext", + "plaintext": "", + "expected": "" + }, { "description": "Lowercase", "property": "ciphertext", @@ -20,12 +26,6 @@ "plaintext": "@1,%!", "expected": "1" }, - { - "description": "empty plaintext results in an empty ciphertext", - "property": "ciphertext", - "plaintext": "", - "expected": "" - }, { "description": "9 character plaintext results in 3 chunks of 3 characters", "property": "ciphertext", From 2bcf27d90a7f9f854d94ddbc29b9f3bd50d6092b Mon Sep 17 00:00:00 2001 From: Nick Holden Date: Mon, 9 Oct 2017 13:25:14 -0700 Subject: [PATCH 3/4] Add new test case --- exercises/crypto-square/canonical-data.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exercises/crypto-square/canonical-data.json b/exercises/crypto-square/canonical-data.json index 14e5b5c357..2326d1ee2f 100644 --- a/exercises/crypto-square/canonical-data.json +++ b/exercises/crypto-square/canonical-data.json @@ -32,6 +32,12 @@ "plaintext": "This is fun!", "expected": "tsf hiu isn" }, + { + "description": "8 character plaintext results in 3 chunks, the last one with a trailing space", + "property": "ciphertext", + "plaintext": "Chill out.", + "expected": "clu hlt io " + }, { "description": "54 character plaintext results in 7 chunks, the last two padded with spaces", "property": "ciphertext", From e93774463a9b164a93a87877c1a85955456a6090 Mon Sep 17 00:00:00 2001 From: Nick Holden Date: Mon, 9 Oct 2017 13:26:15 -0700 Subject: [PATCH 4/4] Clarify location of spaces in test case description --- exercises/crypto-square/canonical-data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/crypto-square/canonical-data.json b/exercises/crypto-square/canonical-data.json index 2326d1ee2f..b5e0f2832b 100644 --- a/exercises/crypto-square/canonical-data.json +++ b/exercises/crypto-square/canonical-data.json @@ -39,7 +39,7 @@ "expected": "clu hlt io " }, { - "description": "54 character plaintext results in 7 chunks, the last two padded with spaces", + "description": "54 character plaintext results in 7 chunks, the last two with trailing spaces", "property": "ciphertext", "plaintext": "If man was meant to stay on the ground, god would have given us roots.", "expected": "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau "