Skip to content

Commit

Permalink
luhn: tweak canonical tests (#547)
Browse files Browse the repository at this point in the history
* luhn: tweak canonical tests

* luhn: further adjustments to canonical test suite
  • Loading branch information
stkent authored and ErikSchierboom committed Feb 21, 2017
1 parent b381653 commit 715e23e
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions exercises/luhn/canonical-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@
"expected": false
},
{
"description": "simple valid sin",
"input": " 5 9 ",
"description": "a simple valid SIN that remains valid if reversed",
"input": "059",
"expected": true
},
{
"description": "valid Canadian SIN",
"input": "046 454 286",
"description": "a simple valid SIN that becomes invalid if reversed",
"input": "59",
"expected": true
},
{
"description": "a valid Canadian SIN",
"input": "055 444 285",
"expected": true
},
{
"description": "invalid Canadian SIN",
"input": "046 454 287",
"input": "055 444 286",
"expected": false
},
{
Expand All @@ -31,17 +36,17 @@
"expected": false
},
{
"description": "valid strings with a non-digit added become invalid",
"input": "046a 454 286",
"description": "valid strings with a non-digit included become invalid",
"input": "055a 444 285",
"expected": false
},
{
"description": "punctuation is not allowed",
"description": "valid strings with punctuation included become invalid",
"input": "055-444-285",
"expected": false
},
{
"description": "symbols are not allowed",
"description": "valid strings with symbols included become invalid",
"input": "055£ 444$ 285",
"expected": false
},
Expand All @@ -51,17 +56,12 @@
"expected": false
},
{
"description": "lots of zeros are valid",
"input": " 00000",
"expected": true
},
{
"description": "another valid sin",
"input": "055 444 285",
"description": "more than a single zero is valid",
"input": "0000 0",
"expected": true
},
{
"description": "nine doubled is nine",
"description": "input digit 9 is correctly converted to output digit 9",
"input": "091",
"expected": true
}
Expand Down

0 comments on commit 715e23e

Please sign in to comment.