From c8263726ed61e9ae553a61c18b15918c4f226f30 Mon Sep 17 00:00:00 2001 From: rbasso Date: Tue, 7 Mar 2017 05:08:47 +0900 Subject: [PATCH] luhn: Make canonical-data.json compliant --- exercises/luhn/canonical-data.json | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/exercises/luhn/canonical-data.json b/exercises/luhn/canonical-data.json index e9014c2504..77a66679d9 100644 --- a/exercises/luhn/canonical-data.json +++ b/exercises/luhn/canonical-data.json @@ -1,67 +1,82 @@ { - "valid": [ + "exercise": "luhn", + "version": "1.0.0", + "cases": [ { "description": "single digit strings can not be valid", + "property": "valid", "input": "1", "expected": false }, { "description": "A single zero is invalid", + "property": "valid", "input": "0", "expected": false }, { "description": "a simple valid SIN that remains valid if reversed", + "property": "valid", "input": "059", "expected": true }, { "description": "a simple valid SIN that becomes invalid if reversed", + "property": "valid", "input": "59", "expected": true }, { "description": "a valid Canadian SIN", + "property": "valid", "input": "055 444 285", "expected": true }, { "description": "invalid Canadian SIN", + "property": "valid", "input": "055 444 286", "expected": false }, { "description": "invalid credit card", + "property": "valid", "input": "8273 1232 7352 0569", "expected": false }, { "description": "valid strings with a non-digit included become invalid", + "property": "valid", "input": "055a 444 285", "expected": false }, { "description": "valid strings with punctuation included become invalid", + "property": "valid", "input": "055-444-285", "expected": false }, { "description": "valid strings with symbols included become invalid", + "property": "valid", "input": "055£ 444$ 285", "expected": false }, { "description": "single zero with space is invalid", + "property": "valid", "input": " 0", "expected": false }, { "description": "more than a single zero is valid", + "property": "valid", "input": "0000 0", "expected": true }, { "description": "input digit 9 is correctly converted to output digit 9", + "property": "valid", "input": "091", "expected": true }