From 5d97048d917d5a3eec1bb993190ea9e68f71c10d Mon Sep 17 00:00:00 2001 From: Vankog Date: Fri, 8 Sep 2017 15:08:56 +0200 Subject: [PATCH 1/3] reworked pangram spec to account for a teachable BDD/TDD progression with suitable edge cases: https://github.com/exercism/problem-specifications/pull/893 --- exercises/pangram/canonical-data.json | 60 +++++++++++++++++++-------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/exercises/pangram/canonical-data.json b/exercises/pangram/canonical-data.json index a2a69e05b6..1cf92e6920 100644 --- a/exercises/pangram/canonical-data.json +++ b/exercises/pangram/canonical-data.json @@ -3,7 +3,7 @@ "comments": [ "A pangram is a sentence using every letter of the alphabet at least once." ], - "version": "1.1.0", + "version": "1.2.0", "cases": [ { "description": "Check if the given string is an pangram", @@ -12,57 +12,81 @@ ], "cases": [ { - "description": "sentence empty", + "description": "can handle an empty sentence", "property": "isPangram", "input": "", "expected": false }, { - "description": "pangram with only lower case", + "description": "handles an undefined message as empty message", "property": "isPangram", - "input": "the quick brown fox jumps over the lazy dog", + "input": "null", + "expected": false + }, + { + "description": "recognizes a lower case pangram", + "property": "isPangram", + "input": "thequickbrownfoxjumpsoverthelazydog", "expected": true }, { - "description": "missing character 'x'", + "description": "recognizes a missing character 'x'", + "property": "isPangram", + "input": "aquickmovementoftheenemywilljeopardizefivegunboats", + "expected": false + }, + { + "description": "recognizes a missing character 'h'", "property": "isPangram", - "input": "a quick movement of the enemy will jeopardize five gunboats", + "input": "fiveboxingwizardsjumpquicklyatit", "expected": false }, { - "description": "another missing character 'x'", + "description": "recognizes an upper case pangram", "property": "isPangram", - "input": "the quick brown fish jumps over the lazy dog", + "input": "THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG", + "expected": true + }, + { + "description": "recognizes a missing character in upper case", + "property": "isPangram", + "input": "THEQUICKBROWNFOXJUMPSOVERTHELAZYDOLL", "expected": false }, { - "description": "pangram with underscores", + "description": "recognizes a mixed case pangram", "property": "isPangram", - "input": "the_quick_brown_fox_jumps_over_the_lazy_dog", + "input": "ThEFiVebOxInGWiZaRdSJuMpqUiCkLy", "expected": true }, { - "description": "pangram with numbers", + "description": "recognizes a missing character in mixed case", + "property": "isPangram", + "input": "ThEFiVebOxInGWiZaRdSJuMpqUiCkL", + "expected": false + }, + { + "description": "ignores other characters in correct pangram", "property": "isPangram", - "input": "the 1 quick brown fox jumps over the 2 lazy dogs", + "input": "Victor_jagt-zwölf.B0xkämpfer >qu3r<über;den'großen\" Sylter#Deich!", "expected": true }, { - "description": "missing letters replaced by numbers", + "description": "ignores other characters in incorrect pangram", "property": "isPangram", - "input": "7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog", + "input": "Victor_jagt-zwölf.B0xkämpfer >qu3r< über;einen'großen\" Sylter#Teich!", "expected": false }, { - "description": "pangram with mixed case and punctuation", + "description": "ignores non-ANSI characters in correct pangram", "property": "isPangram", - "input": "\"Five quacking Zephyrs jolt my wax bed.\"", + "input": "Few quips galvanized the ① mock 😮 jury box 🗃️.", "expected": true }, { - "description": "upper and lower case versions of the same character should not be counted separately", + "description": "ignores non-ANSI characters in incorrect pangram", "property": "isPangram", - "input": "the quick brown fox jumps over with lazy FX", + "input": "Few quips gal℣anized the ① mock 😮 jury box 🗃️.", "expected": false } ] From 92180f105afe82ef53e5f26ed4ee2b9416296210 Mon Sep 17 00:00:00 2001 From: Vankog Date: Fri, 15 Sep 2017 18:12:09 +0200 Subject: [PATCH 2/3] refine pangram test after feedback https://github.com/exercism/problem-specifications/pull/893 --- exercises/pangram/canonical-data.json | 40 ++++++++++----------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/exercises/pangram/canonical-data.json b/exercises/pangram/canonical-data.json index 1cf92e6920..35f3cfd875 100644 --- a/exercises/pangram/canonical-data.json +++ b/exercises/pangram/canonical-data.json @@ -6,88 +6,76 @@ "version": "1.2.0", "cases": [ { - "description": "Check if the given string is an pangram", + "description": "checks if the given string is a pangram.", "comments": [ "Output should be a boolean denoting if the string is a pangram or not." ], "cases": [ { - "description": "can handle an empty sentence", + "description": "returns false for an empty message.", "property": "isPangram", "input": "", "expected": false }, { - "description": "handles an undefined message as empty message", + "description": "returns false for an undefined/null message as argument.", "property": "isPangram", - "input": "null", + "input": null, "expected": false }, { - "description": "recognizes a lower case pangram", + "description": "recognizes a perfect lower case pangram.", "property": "isPangram", - "input": "thequickbrownfoxjumpsoverthelazydog", + "input": "abcdefghijklmnopqrstuvwxyz", "expected": true }, { - "description": "recognizes a missing character 'x'", + "description": "recognizes missing characters, e.g. 'x'.", "property": "isPangram", "input": "aquickmovementoftheenemywilljeopardizefivegunboats", "expected": false }, { - "description": "recognizes a missing character 'h'", + "description": "recognizes missing characters, e.g. 'h'.", "property": "isPangram", "input": "fiveboxingwizardsjumpquicklyatit", "expected": false }, { - "description": "recognizes an upper case pangram", + "description": "recognizes an upper-case pangram.", "property": "isPangram", "input": "THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG", "expected": true }, { - "description": "recognizes a missing character in upper case", + "description": "recognizes a missing character in upper-case, e.g. 'G'.", "property": "isPangram", "input": "THEQUICKBROWNFOXJUMPSOVERTHELAZYDOLL", "expected": false }, { - "description": "recognizes a mixed case pangram", + "description": "recognizes a mixed-case pangram.", "property": "isPangram", "input": "ThEFiVebOxInGWiZaRdSJuMpqUiCkLy", "expected": true }, { - "description": "recognizes a missing character in mixed case", + "description": "recognizes a missing character in mixed-case, e.g. 'Y'.", "property": "isPangram", "input": "ThEFiVebOxInGWiZaRdSJuMpqUiCkL", "expected": false }, { - "description": "ignores other characters in correct pangram", + "description": "recognizes a pangram even if additional characters other than a-z are present.", "property": "isPangram", "input": "Victor_jagt-zwölf.B0xkämpfer >qu3r<über;den'großen\" Sylter#Deich!", "expected": true }, { - "description": "ignores other characters in incorrect pangram", + "description": "recognizes missing characters (e.g. 'd') even if additional characters other than a-z are present.", "property": "isPangram", "input": "Victor_jagt-zwölf.B0xkämpfer >qu3r< über;einen'großen\" Sylter#Teich!", "expected": false - }, - { - "description": "ignores non-ANSI characters in correct pangram", - "property": "isPangram", - "input": "Few quips galvanized the ① mock 😮 jury box 🗃️.", - "expected": true - }, - { - "description": "ignores non-ANSI characters in incorrect pangram", - "property": "isPangram", - "input": "Few quips gal℣anized the ① mock 😮 jury box 🗃️.", - "expected": false } ] } From ed25b5c331e43e46bd9fa29c3553f41a07ef44b1 Mon Sep 17 00:00:00 2001 From: Vankog Date: Fri, 6 Oct 2017 17:32:12 +0200 Subject: [PATCH 3/3] new revision of pangram exercism/problem-specifications#893 --- exercises/pangram/canonical-data.json | 39 ++++++++++++++++----------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/exercises/pangram/canonical-data.json b/exercises/pangram/canonical-data.json index 35f3cfd875..e92e5127f3 100644 --- a/exercises/pangram/canonical-data.json +++ b/exercises/pangram/canonical-data.json @@ -1,7 +1,14 @@ { "exercise": "pangram", "comments": [ - "A pangram is a sentence using every letter of the alphabet at least once." + "A pangram is a sentence using every letter of the alphabet at least once.", + "", + "It is the track's responsibility to add further language specific tests, like:", + "input error handling (null/undefined parameters etc.)", + "referential transparency (i.e. evaluating, a function/method gives the same value for same arguments every time.)", + "etc.", + "", + "'error' and 'null' should be treated according to the languages' specifics and possibilities." ], "version": "1.2.0", "cases": [ @@ -18,63 +25,63 @@ "expected": false }, { - "description": "returns false for an undefined/null message as argument.", + "description": "recognizes a perfect lower case pangram.", "property": "isPangram", - "input": null, - "expected": false + "input": "abcdefghijklmnopqrstuvwxyz", + "expected": true }, { - "description": "recognizes a perfect lower case pangram.", + "description": "recognizes lower case pangram with spaces.", "property": "isPangram", - "input": "abcdefghijklmnopqrstuvwxyz", + "input": "few quips galvanized the mock jury box", "expected": true }, { "description": "recognizes missing characters, e.g. 'x'.", "property": "isPangram", - "input": "aquickmovementoftheenemywilljeopardizefivegunboats", + "input": "a quick movement of the enemy will jeopardize five gunboats", "expected": false }, { "description": "recognizes missing characters, e.g. 'h'.", "property": "isPangram", - "input": "fiveboxingwizardsjumpquicklyatit", + "input": "five boxing wizards jump quickly at it", "expected": false }, { "description": "recognizes an upper-case pangram.", "property": "isPangram", - "input": "THEQUICKBROWNFOXJUMPSOVERTHELAZYDOG", + "input": "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG", "expected": true }, { "description": "recognizes a missing character in upper-case, e.g. 'G'.", "property": "isPangram", - "input": "THEQUICKBROWNFOXJUMPSOVERTHELAZYDOLL", + "input": "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOLL", "expected": false }, { "description": "recognizes a mixed-case pangram.", "property": "isPangram", - "input": "ThEFiVebOxInGWiZaRdSJuMpqUiCkLy", + "input": "ThE FiVe bOxInG WiZaRdS JuMp qUiCkLy", "expected": true }, { "description": "recognizes a missing character in mixed-case, e.g. 'Y'.", "property": "isPangram", - "input": "ThEFiVebOxInGWiZaRdSJuMpqUiCkL", + "input": "ThE FiVe bOxInG WiZaRdS JuMp qUiCkL", "expected": false }, { - "description": "recognizes a pangram even if additional characters other than a-z are present.", + "description": "recognizes a pangram with special characters.", "property": "isPangram", - "input": "Victor_jagt-zwölf.B0xkämpfer >qu3r<über;den'großen\" Sylter#Deich!", + "input": "Sphinx_of-'black\" .quartz, >judge< my; #v0w!", "expected": true }, { - "description": "recognizes missing characters (e.g. 'd') even if additional characters other than a-z are present.", + "description": "recognizes missing characters (e.g. 'o') with special characters present.", "property": "isPangram", - "input": "Victor_jagt-zwölf.B0xkämpfer >qu3r< über;einen'großen\" Sylter#Teich!", + "input": "Sphinx_0f-'black\" .quartz, >judge< my; #v0w!", "expected": false } ]