From 0f0b5f592606077551577b9e936b922d5df36e07 Mon Sep 17 00:00:00 2001 From: rbasso Date: Tue, 7 Mar 2017 13:57:55 +0900 Subject: [PATCH 1/2] binary: Make canonical-data.json compliant --- exercises/binary/canonical-data.json | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/exercises/binary/canonical-data.json b/exercises/binary/canonical-data.json index b0544c8a34..b12b2d5462 100644 --- a/exercises/binary/canonical-data.json +++ b/exercises/binary/canonical-data.json @@ -1,77 +1,94 @@ { - "decimal": [ + "exercise": "binary", + "version": "1.0.0", + "cases": [ { "description": "binary 0 is decimal 0", + "property": "decimal", "binary": "0", "expected": 0 }, { "description": "binary 1 is decimal 1", + "property": "decimal", "binary": "1", "expected": 1 }, { "description": "binary 10 is decimal 2", + "property": "decimal", "binary": "10", "expected": 2 }, { "description": "binary 11 is decimal 3", + "property": "decimal", "binary": "11", "expected": 3 }, { "description": "binary 100 is decimal 4", + "property": "decimal", "binary": "100", "expected": 4 }, { "description": "binary 1001 is decimal 9", + "property": "decimal", "binary": "1001", "expected": 9 }, { "description": "binary 11010 is decimal 26", + "property": "decimal", "binary": "11010", "expected": 26 }, { "description": "binary 10001101000 is decimal 1128", + "property": "decimal", "binary": "10001101000", "expected": 1128 }, { "description": "binary ignores leading zeros", + "property": "decimal", "binary": "000011111", "expected": 31 }, { "description": "2 is not a valid binary digit", + "property": "decimal", "binary": "2", "expected": null }, { "description": "a number containing a non-binary digit is invalid", + "property": "decimal", "binary": "01201", "expected": null }, { "description": "a number with trailing non-binary characters is invalid", + "property": "decimal", "binary": "10nope", "expected": null }, { "description": "a number with leading non-binary characters is invalid", + "property": "decimal", "binary": "nope10", "expected": null }, { "description": "a number with internal non-binary characters is invalid", + "property": "decimal", "binary": "10nope10", "expected": null }, { "description": "a number and a word whitespace spearated is invalid", + "property": "decimal", "binary": "001 nope", "expected": null } From 969717dc40712ef380a2ea9315e260ec86c17cc5 Mon Sep 17 00:00:00 2001 From: rbasso Date: Tue, 7 Mar 2017 13:58:36 +0900 Subject: [PATCH 2/2] binary: Fix canonical-data.json formatting --- exercises/binary/canonical-data.json | 182 +++++++++++++-------------- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/exercises/binary/canonical-data.json b/exercises/binary/canonical-data.json index b12b2d5462..844421715f 100644 --- a/exercises/binary/canonical-data.json +++ b/exercises/binary/canonical-data.json @@ -2,95 +2,95 @@ "exercise": "binary", "version": "1.0.0", "cases": [ - { - "description": "binary 0 is decimal 0", - "property": "decimal", - "binary": "0", - "expected": 0 - }, - { - "description": "binary 1 is decimal 1", - "property": "decimal", - "binary": "1", - "expected": 1 - }, - { - "description": "binary 10 is decimal 2", - "property": "decimal", - "binary": "10", - "expected": 2 - }, - { - "description": "binary 11 is decimal 3", - "property": "decimal", - "binary": "11", - "expected": 3 - }, - { - "description": "binary 100 is decimal 4", - "property": "decimal", - "binary": "100", - "expected": 4 - }, - { - "description": "binary 1001 is decimal 9", - "property": "decimal", - "binary": "1001", - "expected": 9 - }, - { - "description": "binary 11010 is decimal 26", - "property": "decimal", - "binary": "11010", - "expected": 26 - }, - { - "description": "binary 10001101000 is decimal 1128", - "property": "decimal", - "binary": "10001101000", - "expected": 1128 - }, - { - "description": "binary ignores leading zeros", - "property": "decimal", - "binary": "000011111", - "expected": 31 - }, - { - "description": "2 is not a valid binary digit", - "property": "decimal", - "binary": "2", - "expected": null - }, - { - "description": "a number containing a non-binary digit is invalid", - "property": "decimal", - "binary": "01201", - "expected": null - }, - { - "description": "a number with trailing non-binary characters is invalid", - "property": "decimal", - "binary": "10nope", - "expected": null - }, - { - "description": "a number with leading non-binary characters is invalid", - "property": "decimal", - "binary": "nope10", - "expected": null - }, - { - "description": "a number with internal non-binary characters is invalid", - "property": "decimal", - "binary": "10nope10", - "expected": null - }, - { - "description": "a number and a word whitespace spearated is invalid", - "property": "decimal", - "binary": "001 nope", - "expected": null - } - ] + { + "description": "binary 0 is decimal 0", + "property": "decimal", + "binary": "0", + "expected": 0 + }, + { + "description": "binary 1 is decimal 1", + "property": "decimal", + "binary": "1", + "expected": 1 + }, + { + "description": "binary 10 is decimal 2", + "property": "decimal", + "binary": "10", + "expected": 2 + }, + { + "description": "binary 11 is decimal 3", + "property": "decimal", + "binary": "11", + "expected": 3 + }, + { + "description": "binary 100 is decimal 4", + "property": "decimal", + "binary": "100", + "expected": 4 + }, + { + "description": "binary 1001 is decimal 9", + "property": "decimal", + "binary": "1001", + "expected": 9 + }, + { + "description": "binary 11010 is decimal 26", + "property": "decimal", + "binary": "11010", + "expected": 26 + }, + { + "description": "binary 10001101000 is decimal 1128", + "property": "decimal", + "binary": "10001101000", + "expected": 1128 + }, + { + "description": "binary ignores leading zeros", + "property": "decimal", + "binary": "000011111", + "expected": 31 + }, + { + "description": "2 is not a valid binary digit", + "property": "decimal", + "binary": "2", + "expected": null + }, + { + "description": "a number containing a non-binary digit is invalid", + "property": "decimal", + "binary": "01201", + "expected": null + }, + { + "description": "a number with trailing non-binary characters is invalid", + "property": "decimal", + "binary": "10nope", + "expected": null + }, + { + "description": "a number with leading non-binary characters is invalid", + "property": "decimal", + "binary": "nope10", + "expected": null + }, + { + "description": "a number with internal non-binary characters is invalid", + "property": "decimal", + "binary": "10nope10", + "expected": null + }, + { + "description": "a number and a word whitespace spearated is invalid", + "property": "decimal", + "binary": "001 nope", + "expected": null + } + ] }