From ff103eb02bdf05dd3b2c14db561dd808489fdf31 Mon Sep 17 00:00:00 2001 From: rbasso Date: Sat, 11 Mar 2017 19:12:58 +0900 Subject: [PATCH 1/3] sublist: Make canonical-data.json compliant --- exercises/sublist/canonical-data.json | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/exercises/sublist/canonical-data.json b/exercises/sublist/canonical-data.json index b9a825c2b7..2bf09839f4 100644 --- a/exercises/sublist/canonical-data.json +++ b/exercises/sublist/canonical-data.json @@ -1,5 +1,7 @@ { - "#": [ + "exercise": "sublist", + "version": "1.0.0", + "comments": [ "Lists are ordered and sequential.", "https://en.wikipedia.org/wiki/List_%28abstract_data_type%29", "", @@ -14,86 +16,103 @@ ], "cases": [{ "description": "empty lists", + "property": "sublist", "list_one": [], "list_two": [], "expectation": "equal" }, { "description": "empty list within non empty list", + "property": "sublist", "list_one": [], "list_two": [1, 2, 3], "expectation": "sublist" }, { "description": "non empty list contains empty list", + "property": "sublist", "list_one": [1, 2, 3], "list_two": [], "expectation": "superlist" }, { "description": "list equals itself", + "property": "sublist", "list_one": [1, 2, 3], "list_two": [1, 2, 3], "expectation": "equal" }, { "description": "different lists", + "property": "sublist", "list_one": [1, 2, 3], "list_two": [2, 3, 4], "expectation": "unequal" }, { "description": "false start", + "property": "sublist", "list_one": [1, 2, 5], "list_two": [0, 1, 2, 3, 1, 2, 5, 6], "expectation": "sublist" }, { "description": "consecutive", + "property": "sublist", "list_one": [1, 1, 2], "list_two": [0, 1, 1, 1, 2, 1, 2], "expectation": "sublist" }, { "description": "sublist at start", + "property": "sublist", "list_one": [0, 1, 2], "list_two": [0, 1, 2, 3, 4, 5], "expectation": "sublist" }, { "description": "sublist in middle", + "property": "sublist", "list_one": [2, 3, 4], "list_two": [0, 1, 2, 3, 4, 5], "expectation": "sublist" }, { "description": "sublist at end", + "property": "sublist", "list_one": [3, 4, 5], "list_two": [0, 1, 2, 3, 4, 5], "expectation": "sublist" }, { "description": "at start of superlist", + "property": "sublist", "list_one": [0, 1, 2, 3, 4, 5], "list_two": [0, 1, 2], "expectation": "superlist" }, { "description": "in middle of superlist", + "property": "sublist", "list_one": [0, 1, 2, 3, 4, 5], "list_two": [2, 3], "expectation": "superlist" }, { "description": "at end of superlist", + "property": "sublist", "list_one": [0, 1, 2, 3, 4, 5], "list_two": [3, 4, 5], "expectation": "superlist" }, { "description": "first list missing element from second list", + "property": "sublist", "list_one": [1, 3], "list_two": [1, 2, 3], "expectation": "unequal" }, { "description": "second list missing element from first list", + "property": "sublist", "list_one": [1, 2, 3], "list_two": [1, 3], "expectation": "unequal" }, { "description": "order matters to a list", + "property": "sublist", "list_one": [1, 2, 3], "list_two": [3, 2, 1], "expectation": "unequal" }, { "description": "same digits but different numbers", + "property": "sublist", "list_one": [1, 0, 1], "list_two": [10, 1], "expectation": "unequal" From a7f29e52d9218bf8e552368d7e7812aa1e298241 Mon Sep 17 00:00:00 2001 From: rbasso Date: Sat, 11 Mar 2017 20:33:09 +0900 Subject: [PATCH 2/3] sublist: Fix key names Change key names: - 'expectation' -> 'expected', which is an informal standard - 'list_one' -> 'listOne' - 'list_two' -> 'listTwo' These last two changes are to follow the Google JSON Style Guide, which recommends camelCase for key names. --- exercises/sublist/canonical-data.json | 102 +++++++++++++------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/exercises/sublist/canonical-data.json b/exercises/sublist/canonical-data.json index 2bf09839f4..dba4b34579 100644 --- a/exercises/sublist/canonical-data.json +++ b/exercises/sublist/canonical-data.json @@ -17,104 +17,104 @@ "cases": [{ "description": "empty lists", "property": "sublist", - "list_one": [], - "list_two": [], - "expectation": "equal" + "listOne": [], + "listTwo": [], + "expected": "equal" }, { "description": "empty list within non empty list", "property": "sublist", - "list_one": [], - "list_two": [1, 2, 3], - "expectation": "sublist" + "listOne": [], + "listTwo": [1, 2, 3], + "expected": "sublist" }, { "description": "non empty list contains empty list", "property": "sublist", - "list_one": [1, 2, 3], - "list_two": [], - "expectation": "superlist" + "listOne": [1, 2, 3], + "listTwo": [], + "expected": "superlist" }, { "description": "list equals itself", "property": "sublist", - "list_one": [1, 2, 3], - "list_two": [1, 2, 3], - "expectation": "equal" + "listOne": [1, 2, 3], + "listTwo": [1, 2, 3], + "expected": "equal" }, { "description": "different lists", "property": "sublist", - "list_one": [1, 2, 3], - "list_two": [2, 3, 4], - "expectation": "unequal" + "listOne": [1, 2, 3], + "listTwo": [2, 3, 4], + "expected": "unequal" }, { "description": "false start", "property": "sublist", - "list_one": [1, 2, 5], - "list_two": [0, 1, 2, 3, 1, 2, 5, 6], - "expectation": "sublist" + "listOne": [1, 2, 5], + "listTwo": [0, 1, 2, 3, 1, 2, 5, 6], + "expected": "sublist" }, { "description": "consecutive", "property": "sublist", - "list_one": [1, 1, 2], - "list_two": [0, 1, 1, 1, 2, 1, 2], - "expectation": "sublist" + "listOne": [1, 1, 2], + "listTwo": [0, 1, 1, 1, 2, 1, 2], + "expected": "sublist" }, { "description": "sublist at start", "property": "sublist", - "list_one": [0, 1, 2], - "list_two": [0, 1, 2, 3, 4, 5], - "expectation": "sublist" + "listOne": [0, 1, 2], + "listTwo": [0, 1, 2, 3, 4, 5], + "expected": "sublist" }, { "description": "sublist in middle", "property": "sublist", - "list_one": [2, 3, 4], - "list_two": [0, 1, 2, 3, 4, 5], - "expectation": "sublist" + "listOne": [2, 3, 4], + "listTwo": [0, 1, 2, 3, 4, 5], + "expected": "sublist" }, { "description": "sublist at end", "property": "sublist", - "list_one": [3, 4, 5], - "list_two": [0, 1, 2, 3, 4, 5], - "expectation": "sublist" + "listOne": [3, 4, 5], + "listTwo": [0, 1, 2, 3, 4, 5], + "expected": "sublist" }, { "description": "at start of superlist", "property": "sublist", - "list_one": [0, 1, 2, 3, 4, 5], - "list_two": [0, 1, 2], - "expectation": "superlist" + "listOne": [0, 1, 2, 3, 4, 5], + "listTwo": [0, 1, 2], + "expected": "superlist" }, { "description": "in middle of superlist", "property": "sublist", - "list_one": [0, 1, 2, 3, 4, 5], - "list_two": [2, 3], - "expectation": "superlist" + "listOne": [0, 1, 2, 3, 4, 5], + "listTwo": [2, 3], + "expected": "superlist" }, { "description": "at end of superlist", "property": "sublist", - "list_one": [0, 1, 2, 3, 4, 5], - "list_two": [3, 4, 5], - "expectation": "superlist" + "listOne": [0, 1, 2, 3, 4, 5], + "listTwo": [3, 4, 5], + "expected": "superlist" }, { "description": "first list missing element from second list", "property": "sublist", - "list_one": [1, 3], - "list_two": [1, 2, 3], - "expectation": "unequal" + "listOne": [1, 3], + "listTwo": [1, 2, 3], + "expected": "unequal" }, { "description": "second list missing element from first list", "property": "sublist", - "list_one": [1, 2, 3], - "list_two": [1, 3], - "expectation": "unequal" + "listOne": [1, 2, 3], + "listTwo": [1, 3], + "expected": "unequal" }, { "description": "order matters to a list", "property": "sublist", - "list_one": [1, 2, 3], - "list_two": [3, 2, 1], - "expectation": "unequal" + "listOne": [1, 2, 3], + "listTwo": [3, 2, 1], + "expected": "unequal" }, { "description": "same digits but different numbers", "property": "sublist", - "list_one": [1, 0, 1], - "list_two": [10, 1], - "expectation": "unequal" + "listOne": [1, 0, 1], + "listTwo": [10, 1], + "expected": "unequal" }] } From 71e24b5be6380258ac8e78c65ca622ab7a5036d5 Mon Sep 17 00:00:00 2001 From: rbasso Date: Sat, 11 Mar 2017 20:51:09 +0900 Subject: [PATCH 3/3] sublist: Fix canonical-data.json formatting --- exercises/sublist/canonical-data.json | 250 ++++++++++++++------------ 1 file changed, 134 insertions(+), 116 deletions(-) diff --git a/exercises/sublist/canonical-data.json b/exercises/sublist/canonical-data.json index dba4b34579..006b41f9ae 100644 --- a/exercises/sublist/canonical-data.json +++ b/exercises/sublist/canonical-data.json @@ -1,120 +1,138 @@ { "exercise": "sublist", "version": "1.0.0", - "comments": [ - "Lists are ordered and sequential.", - "https://en.wikipedia.org/wiki/List_%28abstract_data_type%29", - "", - "Depending on your language, there may need to be some translation", - "to go from the JSON array to the list representation.", - "The expectation can be used to generate an expected value", - "based on your implementation (such as a constant 'EQUAL', 'SUBLIST', etc.).", - "", - "If appropriate for your track, you'll need to ensure that no pair of expected values are equal.", - "Otherwise, an implementation that always returns a constant value may falsely pass the tests.", - "See https://github.com/exercism/xpython/issues/342" - ], - "cases": [{ - "description": "empty lists", - "property": "sublist", - "listOne": [], - "listTwo": [], - "expected": "equal" - }, { - "description": "empty list within non empty list", - "property": "sublist", - "listOne": [], - "listTwo": [1, 2, 3], - "expected": "sublist" - }, { - "description": "non empty list contains empty list", - "property": "sublist", - "listOne": [1, 2, 3], - "listTwo": [], - "expected": "superlist" - }, { - "description": "list equals itself", - "property": "sublist", - "listOne": [1, 2, 3], - "listTwo": [1, 2, 3], - "expected": "equal" - }, { - "description": "different lists", - "property": "sublist", - "listOne": [1, 2, 3], - "listTwo": [2, 3, 4], - "expected": "unequal" - }, { - "description": "false start", - "property": "sublist", - "listOne": [1, 2, 5], - "listTwo": [0, 1, 2, 3, 1, 2, 5, 6], - "expected": "sublist" - }, { - "description": "consecutive", - "property": "sublist", - "listOne": [1, 1, 2], - "listTwo": [0, 1, 1, 1, 2, 1, 2], - "expected": "sublist" - }, { - "description": "sublist at start", - "property": "sublist", - "listOne": [0, 1, 2], - "listTwo": [0, 1, 2, 3, 4, 5], - "expected": "sublist" - }, { - "description": "sublist in middle", - "property": "sublist", - "listOne": [2, 3, 4], - "listTwo": [0, 1, 2, 3, 4, 5], - "expected": "sublist" - }, { - "description": "sublist at end", - "property": "sublist", - "listOne": [3, 4, 5], - "listTwo": [0, 1, 2, 3, 4, 5], - "expected": "sublist" - }, { - "description": "at start of superlist", - "property": "sublist", - "listOne": [0, 1, 2, 3, 4, 5], - "listTwo": [0, 1, 2], - "expected": "superlist" - }, { - "description": "in middle of superlist", - "property": "sublist", - "listOne": [0, 1, 2, 3, 4, 5], - "listTwo": [2, 3], - "expected": "superlist" - }, { - "description": "at end of superlist", - "property": "sublist", - "listOne": [0, 1, 2, 3, 4, 5], - "listTwo": [3, 4, 5], - "expected": "superlist" - }, { - "description": "first list missing element from second list", - "property": "sublist", - "listOne": [1, 3], - "listTwo": [1, 2, 3], - "expected": "unequal" - }, { - "description": "second list missing element from first list", - "property": "sublist", - "listOne": [1, 2, 3], - "listTwo": [1, 3], - "expected": "unequal" - }, { - "description": "order matters to a list", - "property": "sublist", - "listOne": [1, 2, 3], - "listTwo": [3, 2, 1], - "expected": "unequal" - }, { - "description": "same digits but different numbers", - "property": "sublist", - "listOne": [1, 0, 1], - "listTwo": [10, 1], - "expected": "unequal" - }] + "comments": [ + "Lists are ordered and sequential.", + "https://en.wikipedia.org/wiki/List_%28abstract_data_type%29", + "", + "Depending on your language, there may need to be some translation", + "to go from the JSON array to the list representation.", + "The expectation can be used to generate an expected value", + "based on your implementation (such as a constant 'EQUAL', 'SUBLIST', etc.).", + "", + "If appropriate for your track, you'll need to ensure that no pair of expected values are equal.", + "Otherwise, an implementation that always returns a constant value may falsely pass the tests.", + "See https://github.com/exercism/xpython/issues/342" + ], + "cases": [ + { + "description": "empty lists", + "property": "sublist", + "listOne": [], + "listTwo": [], + "expected": "equal" + }, + { + "description": "empty list within non empty list", + "property": "sublist", + "listOne": [], + "listTwo": [1, 2, 3], + "expected": "sublist" + }, + { + "description": "non empty list contains empty list", + "property": "sublist", + "listOne": [1, 2, 3], + "listTwo": [], + "expected": "superlist" + }, + { + "description": "list equals itself", + "property": "sublist", + "listOne": [1, 2, 3], + "listTwo": [1, 2, 3], + "expected": "equal" + }, + { + "description": "different lists", + "property": "sublist", + "listOne": [1, 2, 3], + "listTwo": [2, 3, 4], + "expected": "unequal" + }, + { + "description": "false start", + "property": "sublist", + "listOne": [1, 2, 5], + "listTwo": [0, 1, 2, 3, 1, 2, 5, 6], + "expected": "sublist" + }, + { + "description": "consecutive", + "property": "sublist", + "listOne": [1, 1, 2], + "listTwo": [0, 1, 1, 1, 2, 1, 2], + "expected": "sublist" + }, + { + "description": "sublist at start", + "property": "sublist", + "listOne": [0, 1, 2], + "listTwo": [0, 1, 2, 3, 4, 5], + "expected": "sublist" + }, + { + "description": "sublist in middle", + "property": "sublist", + "listOne": [2, 3, 4], + "listTwo": [0, 1, 2, 3, 4, 5], + "expected": "sublist" + }, + { + "description": "sublist at end", + "property": "sublist", + "listOne": [3, 4, 5], + "listTwo": [0, 1, 2, 3, 4, 5], + "expected": "sublist" + }, + { + "description": "at start of superlist", + "property": "sublist", + "listOne": [0, 1, 2, 3, 4, 5], + "listTwo": [0, 1, 2], + "expected": "superlist" + }, + { + "description": "in middle of superlist", + "property": "sublist", + "listOne": [0, 1, 2, 3, 4, 5], + "listTwo": [2, 3], + "expected": "superlist" + }, + { + "description": "at end of superlist", + "property": "sublist", + "listOne": [0, 1, 2, 3, 4, 5], + "listTwo": [3, 4, 5], + "expected": "superlist" + }, + { + "description": "first list missing element from second list", + "property": "sublist", + "listOne": [1, 3], + "listTwo": [1, 2, 3], + "expected": "unequal" + }, + { + "description": "second list missing element from first list", + "property": "sublist", + "listOne": [1, 2, 3], + "listTwo": [1, 3], + "expected": "unequal" + }, + { + "description": "order matters to a list", + "property": "sublist", + "listOne": [1, 2, 3], + "listTwo": [3, 2, 1], + "expected": "unequal" + }, + { + "description": "same digits but different numbers", + "property": "sublist", + "listOne": [1, 0, 1], + "listTwo": [10, 1], + "expected": "unequal" + } + ] }