From 7ca061769ec2b8f7329b5cf8caacb15180929076 Mon Sep 17 00:00:00 2001 From: rbasso Date: Mon, 6 Mar 2017 22:28:44 +0900 Subject: [PATCH 1/3] anagram: Make canonical-data.json compliant --- exercises/anagram/canonical-data.json | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/exercises/anagram/canonical-data.json b/exercises/anagram/canonical-data.json index 100eefb331..68594fa63a 100644 --- a/exercises/anagram/canonical-data.json +++ b/exercises/anagram/canonical-data.json @@ -1,5 +1,7 @@ { - "#": [ + "exercise": "anagram", + "version": "1.0.0", + "comments": [ "The string argument cases possible matches are passed in as", "individual arguments rather than arrays. Languages can include", "these string argument cases if passing individual arguments is", @@ -10,96 +12,112 @@ "cases": [ { "description": "no matches", + "property": "anagrams", "subject": "diaper", "candidates": [ "hello", "world", "zombies", "pants"], "expected": [] }, { "description": "detects simple anagram", + "property": "anagrams", "subject": "ant", "candidates": ["tan", "stand", "at"], "expected": ["tan"] }, { "description": "does not detect false positives", + "property": "anagrams", "subject": "galea", "candidates": ["eagle"], "expected": [] }, { "description": "detects multiple anagrams", + "property": "anagrams", "subject": "master", "candidates": ["stream", "pigeon", "maters"], "expected": ["stream", "maters"] }, { "description": "does not detect anagram subsets", + "property": "anagrams", "subject": "good", "candidates": ["dog", "goody"], "expected": [] }, { "description": "detects anagram", + "property": "anagrams", "subject": "listen", "candidates": ["enlists", "google", "inlets", "banana"], "expected": ["inlets"] }, { "description": "detects multiple anagrams", + "property": "anagrams", "subject": "allergy", "candidates": ["gallery", "ballerina", "regally", "clergy", "largely", "leading"], "expected": ["gallery", "regally", "largely"] }, { "description": "does not detect identical words", + "property": "anagrams", "subject": "corn", "candidates": ["corn", "dark", "Corn", "rank", "CORN", "cron", "park"], "expected": ["cron"] }, { "description": "does not detect non-anagrams with identical checksum", + "property": "anagrams", "subject": "mass", "candidates": ["last"], "expected": [] }, { "description": "detects anagrams case-insensitively", + "property": "anagrams", "subject": "Orchestra", "candidates": ["cashregister", "Carthorse", "radishes"], "expected": ["Carthorse"] }, { "description": "detects anagrams using case-insensitive subject", + "property": "anagrams", "subject": "Orchestra", "candidates": ["cashregister", "carthorse", "radishes"], "expected": ["carthorse"] }, { "description": "detects anagrams using case-insensitive possible matches", + "property": "anagrams", "subject": "orchestra", "candidates": ["cashregister", "Carthorse", "radishes"], "expected": ["Carthorse"] }, { "description": "does not detect a word as its own anagram", + "property": "anagrams", "subject": "banana", "candidates": ["Banana"], "expected": [] }, { "description": "does not detect a anagram if the original word is repeated", + "property": "anagrams", "subject": "go", "candidates": ["go Go GO"], "expected": [] }, { "description": "anagrams must use all letters exactly once", + "property": "anagrams", "subject": "tapper", "candidates": ["patter"], "expected": [] }, { "description": "capital word is not own anagram", + "property": "anagrams", "subject": "BANANA", "candidates": ["Banana"], "expected": [] From e9a5c7bad0576e439ccfd939f182098a67f6f20b Mon Sep 17 00:00:00 2001 From: rbasso Date: Mon, 6 Mar 2017 22:38:29 +0900 Subject: [PATCH 2/3] anagram: Fix canonical-data.json formatting --- exercises/anagram/canonical-data.json | 248 +++++++++++++------------- 1 file changed, 127 insertions(+), 121 deletions(-) diff --git a/exercises/anagram/canonical-data.json b/exercises/anagram/canonical-data.json index 68594fa63a..ca2e66e0ff 100644 --- a/exercises/anagram/canonical-data.json +++ b/exercises/anagram/canonical-data.json @@ -2,125 +2,131 @@ "exercise": "anagram", "version": "1.0.0", "comments": [ - "The string argument cases possible matches are passed in as", - "individual arguments rather than arrays. Languages can include", - "these string argument cases if passing individual arguments is", - "idiomatic in that language.", - "Some tests have a \"comment\" property, which provides more", - "information that could be added to the test case as a code comment." - ], - "cases": [ - { - "description": "no matches", - "property": "anagrams", - "subject": "diaper", - "candidates": [ "hello", "world", "zombies", "pants"], - "expected": [] - }, - { - "description": "detects simple anagram", - "property": "anagrams", - "subject": "ant", - "candidates": ["tan", "stand", "at"], - "expected": ["tan"] - }, - { - "description": "does not detect false positives", - "property": "anagrams", - "subject": "galea", - "candidates": ["eagle"], - "expected": [] - }, - { - "description": "detects multiple anagrams", - "property": "anagrams", - "subject": "master", - "candidates": ["stream", "pigeon", "maters"], - "expected": ["stream", "maters"] - }, - { - "description": "does not detect anagram subsets", - "property": "anagrams", - "subject": "good", - "candidates": ["dog", "goody"], - "expected": [] - }, - { - "description": "detects anagram", - "property": "anagrams", - "subject": "listen", - "candidates": ["enlists", "google", "inlets", "banana"], - "expected": ["inlets"] - }, - { - "description": "detects multiple anagrams", - "property": "anagrams", - "subject": "allergy", - "candidates": ["gallery", "ballerina", "regally", "clergy", "largely", "leading"], - "expected": ["gallery", "regally", "largely"] - }, - { - "description": "does not detect identical words", - "property": "anagrams", - "subject": "corn", - "candidates": ["corn", "dark", "Corn", "rank", "CORN", "cron", "park"], - "expected": ["cron"] - }, - { - "description": "does not detect non-anagrams with identical checksum", - "property": "anagrams", - "subject": "mass", - "candidates": ["last"], - "expected": [] - }, - { - "description": "detects anagrams case-insensitively", - "property": "anagrams", - "subject": "Orchestra", - "candidates": ["cashregister", "Carthorse", "radishes"], - "expected": ["Carthorse"] - }, - { - "description": "detects anagrams using case-insensitive subject", - "property": "anagrams", - "subject": "Orchestra", - "candidates": ["cashregister", "carthorse", "radishes"], - "expected": ["carthorse"] - }, - { - "description": "detects anagrams using case-insensitive possible matches", - "property": "anagrams", - "subject": "orchestra", - "candidates": ["cashregister", "Carthorse", "radishes"], - "expected": ["Carthorse"] - }, - { - "description": "does not detect a word as its own anagram", - "property": "anagrams", - "subject": "banana", - "candidates": ["Banana"], - "expected": [] - }, - { - "description": "does not detect a anagram if the original word is repeated", - "property": "anagrams", - "subject": "go", - "candidates": ["go Go GO"], - "expected": [] - }, - { - "description": "anagrams must use all letters exactly once", - "property": "anagrams", - "subject": "tapper", - "candidates": ["patter"], - "expected": [] - }, - { - "description": "capital word is not own anagram", - "property": "anagrams", - "subject": "BANANA", - "candidates": ["Banana"], - "expected": [] - } - ] + "The string argument cases possible matches are passed in as", + "individual arguments rather than arrays. Languages can include", + "these string argument cases if passing individual arguments is", + "idiomatic in that language.", + "Some tests have a \"comment\" property, which provides more", + "information that could be added to the test case as a code comment." + ], + "cases": [ + { + "description": "no matches", + "property": "anagrams", + "subject": "diaper", + "candidates": ["hello", "world", "zombies", "pants"], + "expected": [] + }, + { + "description": "detects simple anagram", + "property": "anagrams", + "subject": "ant", + "candidates": ["tan", "stand", "at"], + "expected": ["tan"] + }, + { + "description": "does not detect false positives", + "property": "anagrams", + "subject": "galea", + "candidates": ["eagle"], + "expected": [] + }, + { + "description": "detects multiple anagrams", + "property": "anagrams", + "subject": "master", + "candidates": ["stream", "pigeon", "maters"], + "expected": ["stream", "maters"] + }, + { + "description": "does not detect anagram subsets", + "property": "anagrams", + "subject": "good", + "candidates": ["dog", "goody"], + "expected": [] + }, + { + "description": "detects anagram", + "property": "anagrams", + "subject": "listen", + "candidates": ["enlists", "google", "inlets", "banana"], + "expected": ["inlets"] + }, + { + "description": "detects multiple anagrams", + "property": "anagrams", + "subject": "allergy", + "candidates": [ "gallery", + "ballerina", + "regally", + "clergy", + "largely", + "leading" + ], + "expected": ["gallery", "regally", "largely"] + }, + { + "description": "does not detect identical words", + "property": "anagrams", + "subject": "corn", + "candidates": ["corn", "dark", "Corn", "rank", "CORN", "cron", "park"], + "expected": ["cron"] + }, + { + "description": "does not detect non-anagrams with identical checksum", + "property": "anagrams", + "subject": "mass", + "candidates": ["last"], + "expected": [] + }, + { + "description": "detects anagrams case-insensitively", + "property": "anagrams", + "subject": "Orchestra", + "candidates": ["cashregister", "Carthorse", "radishes"], + "expected": ["Carthorse"] + }, + { + "description": "detects anagrams using case-insensitive subject", + "property": "anagrams", + "subject": "Orchestra", + "candidates": ["cashregister", "carthorse", "radishes"], + "expected": ["carthorse"] + }, + { + "description": "detects anagrams using case-insensitive possible matches", + "property": "anagrams", + "subject": "orchestra", + "candidates": ["cashregister", "Carthorse", "radishes"], + "expected": ["Carthorse"] + }, + { + "description": "does not detect a word as its own anagram", + "property": "anagrams", + "subject": "banana", + "candidates": ["Banana"], + "expected": [] + }, + { + "description": "does not detect a anagram if the original word is repeated", + "property": "anagrams", + "subject": "go", + "candidates": ["go Go GO"], + "expected": [] + }, + { + "description": "anagrams must use all letters exactly once", + "property": "anagrams", + "subject": "tapper", + "candidates": ["patter"], + "expected": [] + }, + { + "description": "capital word is not own anagram", + "property": "anagrams", + "subject": "BANANA", + "candidates": ["Banana"], + "expected": [] + } + ] } From 1aae06f3e14d99c8dff81ece8fcc1525d199c032 Mon Sep 17 00:00:00 2001 From: rbasso Date: Mon, 6 Mar 2017 22:40:56 +0900 Subject: [PATCH 3/3] anagram: Remove incorrect comment about test data Remove comment that erroneously says that there are tests cases with additional comments. --- exercises/anagram/canonical-data.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/exercises/anagram/canonical-data.json b/exercises/anagram/canonical-data.json index ca2e66e0ff..02f0b0d80a 100644 --- a/exercises/anagram/canonical-data.json +++ b/exercises/anagram/canonical-data.json @@ -5,9 +5,7 @@ "The string argument cases possible matches are passed in as", "individual arguments rather than arrays. Languages can include", "these string argument cases if passing individual arguments is", - "idiomatic in that language.", - "Some tests have a \"comment\" property, which provides more", - "information that could be added to the test case as a code comment." + "idiomatic in that language." ], "cases": [ {