Skip to content
Merged
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
235 changes: 136 additions & 99 deletions exercises/sublist/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,101 +1,138 @@
{
"#": [
"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",
"list_one": [],
"list_two": [],
"expectation": "equal"
}, {
"description": "empty list within non empty list",
"list_one": [],
"list_two": [1, 2, 3],
"expectation": "sublist"
}, {
"description": "non empty list contains empty list",
"list_one": [1, 2, 3],
"list_two": [],
"expectation": "superlist"
}, {
"description": "list equals itself",
"list_one": [1, 2, 3],
"list_two": [1, 2, 3],
"expectation": "equal"
}, {
"description": "different lists",
"list_one": [1, 2, 3],
"list_two": [2, 3, 4],
"expectation": "unequal"
}, {
"description": "false start",
"list_one": [1, 2, 5],
"list_two": [0, 1, 2, 3, 1, 2, 5, 6],
"expectation": "sublist"
}, {
"description": "consecutive",
"list_one": [1, 1, 2],
"list_two": [0, 1, 1, 1, 2, 1, 2],
"expectation": "sublist"
}, {
"description": "sublist at start",
"list_one": [0, 1, 2],
"list_two": [0, 1, 2, 3, 4, 5],
"expectation": "sublist"
}, {
"description": "sublist in middle",
"list_one": [2, 3, 4],
"list_two": [0, 1, 2, 3, 4, 5],
"expectation": "sublist"
}, {
"description": "sublist at end",
"list_one": [3, 4, 5],
"list_two": [0, 1, 2, 3, 4, 5],
"expectation": "sublist"
}, {
"description": "at start of superlist",
"list_one": [0, 1, 2, 3, 4, 5],
"list_two": [0, 1, 2],
"expectation": "superlist"
}, {
"description": "in middle of superlist",
"list_one": [0, 1, 2, 3, 4, 5],
"list_two": [2, 3],
"expectation": "superlist"
}, {
"description": "at end of superlist",
"list_one": [0, 1, 2, 3, 4, 5],
"list_two": [3, 4, 5],
"expectation": "superlist"
}, {
"description": "first list missing element from second list",
"list_one": [1, 3],
"list_two": [1, 2, 3],
"expectation": "unequal"
}, {
"description": "second list missing element from first list",
"list_one": [1, 2, 3],
"list_two": [1, 3],
"expectation": "unequal"
}, {
"description": "order matters to a list",
"list_one": [1, 2, 3],
"list_two": [3, 2, 1],
"expectation": "unequal"
}, {
"description": "same digits but different numbers",
"list_one": [1, 0, 1],
"list_two": [10, 1],
"expectation": "unequal"
}]
"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"
}
]
}