From 968b1889be1c60d93dcc7a8876c39735a88d211a Mon Sep 17 00:00:00 2001 From: rbasso Date: Sat, 11 Mar 2017 18:51:36 +0900 Subject: [PATCH 1/2] run-length-encoding: Make canonical-data.json compliant --- .../run-length-encoding/canonical-data.json | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/exercises/run-length-encoding/canonical-data.json b/exercises/run-length-encoding/canonical-data.json index 0381482776..9fb1f316ca 100644 --- a/exercises/run-length-encoding/canonical-data.json +++ b/exercises/run-length-encoding/canonical-data.json @@ -1,81 +1,99 @@ { - "encode": { + "exercise": "run-length-encoding", + "version": "1.0.0", + "cases": [ + { "description": "run-length encode a string", "cases": [ { "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", + "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", + "property": "consistency", "input": "zzz ZZ zZ", "expected": "zzz ZZ zZ" } ] } + ] } From 503a57a88c56f97497ccd9ea4fefe86c7f3dad9c Mon Sep 17 00:00:00 2001 From: rbasso Date: Sat, 11 Mar 2017 18:53:10 +0900 Subject: [PATCH 2/2] run-length-encoding: Fix canonical-data.json formatting --- .../run-length-encoding/canonical-data.json | 168 +++++++++--------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/exercises/run-length-encoding/canonical-data.json b/exercises/run-length-encoding/canonical-data.json index 9fb1f316ca..55266bd28a 100644 --- a/exercises/run-length-encoding/canonical-data.json +++ b/exercises/run-length-encoding/canonical-data.json @@ -2,98 +2,98 @@ "exercise": "run-length-encoding", "version": "1.0.0", "cases": [ - { + { "description": "run-length encode a string", "cases": [ - { - "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" - } + { + "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" + } ] - }, - { + }, + { "description": "run-length decode a string", "cases": [ - { - "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" - } + { + "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" + } ] - }, - { + }, + { "description": "encode and then decode", "cases": [ - { - "description": "encode followed by decode gives original string", - "property": "consistency", - "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" + } ] - } + } ] }