Skip to content

atbash-cipher: Make exercise schema-compliant #632

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 7, 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
166 changes: 92 additions & 74 deletions exercises/atbash-cipher/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,77 +1,95 @@
{
"#": [
"The tests are divided into two groups: ",
"* Encoding from English to atbash cipher",
"* Decoding from atbash cipher to all-lowercase-mashed-together English"
],
"encode": {
"description": ["Test encoding from English to atbash"],
"cases": [
{
"description": "encode yes",
"phrase": "yes",
"expected": "bvh"
},
{
"description": "encode no",
"phrase": "no",
"expected": "ml"
},
{
"description": "encode OMG",
"phrase": "OMG",
"expected": "lnt"
},
{
"description": "encode spaces",
"phrase": "O M G",
"expected": "lnt"
},
{
"description": "encode mindblowingly",
"phrase": "mindblowingly",
"expected": "nrmwy oldrm tob"
},
{
"description": "encode numbers",
"phrase": "Testing,1 2 3, testing.",
"expected": "gvhgr mt123 gvhgr mt"
},
{
"description": "encode deep thought",
"phrase": "Truth is fiction.",
"expected": "gifgs rhurx grlm"
},
{
"description": "encode all the letters",
"phrase": "The quick brown fox jumps over the lazy dog.",
"expected": "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
}
]
{
"exercise": "atbash-cipher",
"version": "1.0.0",
"comments": [
"The tests are divided into two groups: ",
"* Encoding from English to atbash cipher",
"* Decoding from atbash cipher to all-lowercase-mashed-together English"
],
"cases": [
{
"description": "encode",
"comments": [ "Test encoding from English to atbash" ],
"cases": [
{
"description": "encode yes",
"property": "encode",
"phrase": "yes",
"expected": "bvh"
},
{
"description": "encode no",
"property": "encode",
"phrase": "no",
"expected": "ml"
},
{
"description": "encode OMG",
"property": "encode",
"phrase": "OMG",
"expected": "lnt"
},
{
"description": "encode spaces",
"property": "encode",
"phrase": "O M G",
"expected": "lnt"
},
{
"description": "encode mindblowingly",
"property": "encode",
"phrase": "mindblowingly",
"expected": "nrmwy oldrm tob"
},
{
"description": "encode numbers",
"property": "encode",
"phrase": "Testing,1 2 3, testing.",
"expected": "gvhgr mt123 gvhgr mt"
},
{
"description": "encode deep thought",
"property": "encode",
"phrase": "Truth is fiction.",
"expected": "gifgs rhurx grlm"
},
{
"description": "encode all the letters",
"property": "encode",
"phrase": "The quick brown fox jumps over the lazy dog.",
"expected": "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt"
}
]
},
"decode": {
"description": ["Test decoding from atbash to English"],
"cases": [
{
"description": "decode exercism",
"phrase": "vcvix rhn",
"expected": "exercism"
},
{
"description": "decode a sentence",
"phrase": "zmlyh gzxov rhlug vmzhg vkkrm thglm v",
"expected": "anobstacleisoftenasteppingstone"
},
{
"description": "decode numbers",
"phrase": "gvhgr mt123 gvhgr mt",
"expected": "testing123testing"
},
{
"description": "decode all the letters",
"phrase": "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt",
"expected": "thequickbrownfoxjumpsoverthelazydog"
}
]
{
"description": "decode",
"comments": [ "Test decoding from atbash to English" ],
"cases": [
{
"description": "decode exercism",
"property": "decode",
"phrase": "vcvix rhn",
"expected": "exercism"
},
{
"description": "decode a sentence",
"property": "decode",
"phrase": "zmlyh gzxov rhlug vmzhg vkkrm thglm v",
"expected": "anobstacleisoftenasteppingstone"
},
{
"description": "decode numbers",
"property": "decode",
"phrase": "gvhgr mt123 gvhgr mt",
"expected": "testing123testing"
},
{
"description": "decode all the letters",
"property": "decode",
"phrase": "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt",
"expected": "thequickbrownfoxjumpsoverthelazydog"
}
]
}
]
}