Skip to content

run-length-encoding: Make exercise schema-compliant #702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 11, 2017
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
160 changes: 89 additions & 71 deletions exercises/run-length-encoding/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,81 +1,99 @@
{
"encode": {
"exercise": "run-length-encoding",
"version": "1.0.0",
"cases": [
{
"description": "run-length encode a string",
"cases": [
{
"description": "empty string",
"input": "",
"expected": ""
},
{
"description": "single characters only are encoded without count",
"input": "XYZ",
"expected": "XYZ"
},
{
"description": "string with no single characters",
"input": "AABBBCCCC",
"expected": "2A3B4C"
},
{
"description": "single characters mixed with repeated characters",
"input": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB",
"expected": "12WB12W3B24WB"
},
{
"description": "multiple whitespace mixed in string",
"input": " hsqq qww ",
"expected": "2 hs2q q2w2 "
},
{
"description": "lowercase characters",
"input": "aabbbcccc",
"expected": "2a3b4c"
}
{
"description": "empty string",
"property": "encode",
"input": "",
"expected": ""
},
{
"description": "single characters only are encoded without count",
"property": "encode",
"input": "XYZ",
"expected": "XYZ"
},
{
"description": "string with no single characters",
"property": "encode",
"input": "AABBBCCCC",
"expected": "2A3B4C"
},
{
"description": "single characters mixed with repeated characters",
"property": "encode",
"input": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB",
"expected": "12WB12W3B24WB"
},
{
"description": "multiple whitespace mixed in string",
"property": "encode",
"input": " hsqq qww ",
"expected": "2 hs2q q2w2 "
},
{
"description": "lowercase characters",
"property": "encode",
"input": "aabbbcccc",
"expected": "2a3b4c"
}
]
},
"decode": {
},
{
"description": "run-length decode a string",
"cases": [
{
"description": "empty string",
"input": "",
"expected": ""
},
{
"description": "single characters only",
"input": "XYZ",
"expected": "XYZ"
},
{
"description": "string with no single characters",
"input": "2A3B4C",
"expected": "AABBBCCCC"
},
{
"description": "single characters with repeated characters",
"input": "12WB12W3B24WB",
"expected": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"
},
{
"description": "multiple whitespace mixed in string",
"input": "2 hs2q q2w2 ",
"expected": " hsqq qww "
},
{
"description": "lower case string",
"input": "2a3b4c",
"expected": "aabbbcccc"
}
{
"description": "empty string",
"property": "decode",
"input": "",
"expected": ""
},
{
"description": "single characters only",
"property": "decode",
"input": "XYZ",
"expected": "XYZ"
},
{
"description": "string with no single characters",
"property": "decode",
"input": "2A3B4C",
"expected": "AABBBCCCC"
},
{
"description": "single characters with repeated characters",
"property": "decode",
"input": "12WB12W3B24WB",
"expected": "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"
},
{
"description": "multiple whitespace mixed in string",
"property": "decode",
"input": "2 hs2q q2w2 ",
"expected": " hsqq qww "
},
{
"description": "lower case string",
"property": "decode",
"input": "2a3b4c",
"expected": "aabbbcccc"
}
]
},
"consistency": {
},
{
"description": "encode and then decode",
"cases": [
{
"description": "encode followed by decode gives original string",
"input": "zzz ZZ zZ",
"expected": "zzz ZZ zZ"
}
{
"description": "encode followed by decode gives original string",
"property": "consistency",
"input": "zzz ZZ zZ",
"expected": "zzz ZZ zZ"
}
]
}
}
]
}