Sha256: be8da36d8b47efad111e3244b7f94e1798dffb0103a668b8d48b2af3cf7aafe1
Contents?: true
Size: 1.11 KB
Versions: 34
Compression:
Stored size: 1.11 KB
Contents
package luhn // Source: exercism/x-common // Commit: 715e23e luhn: tweak canonical tests (#547) var testCases = []struct { description string input string ok bool }{ { "single digit strings can not be valid", "1", false, }, { "A single zero is invalid", "0", false, }, { "a simple valid SIN that remains valid if reversed", "059", true, }, { "a simple valid SIN that becomes invalid if reversed", "59", true, }, { "a valid Canadian SIN", "055 444 285", true, }, { "invalid Canadian SIN", "055 444 286", false, }, { "invalid credit card", "8273 1232 7352 0569", false, }, { "valid strings with a non-digit included become invalid", "055a 444 285", false, }, { "valid strings with punctuation included become invalid", "055-444-285", false, }, { "valid strings with symbols included become invalid", "055£ 444$ 285", false, }, { "single zero with space is invalid", " 0", false, }, { "more than a single zero is valid", "0000 0", true, }, { "input digit 9 is correctly converted to output digit 9", "091", true, }, }
Version data entries
34 entries across 34 versions & 1 rubygems