Sha256: f81d3875c0ef125b4938b5833584938639832e78188c4da376d3e2c3c1a17cca
Contents?: true
Size: 1.52 KB
Versions: 97
Compression:
Stored size: 1.52 KB
Contents
import org.scalatest.{Matchers, FunSuite} /** @version 1.0.0 */ class LuhnTest extends FunSuite with Matchers { test("single digit strings can not be valid") { Luhn.valid("1") should be (false) } test("A single zero is invalid") { pending Luhn.valid("0") should be (false) } test("a simple valid SIN that remains valid if reversed") { pending Luhn.valid("059") should be (true) } test("a simple valid SIN that becomes invalid if reversed") { pending Luhn.valid("59") should be (true) } test("a valid Canadian SIN") { pending Luhn.valid("055 444 285") should be (true) } test("invalid Canadian SIN") { pending Luhn.valid("055 444 286") should be (false) } test("invalid credit card") { pending Luhn.valid("8273 1232 7352 0569") should be (false) } test("valid strings with a non-digit included become invalid") { pending Luhn.valid("055a 444 285") should be (false) } test("valid strings with punctuation included become invalid") { pending Luhn.valid("055-444-285") should be (false) } test("valid strings with symbols included become invalid") { pending Luhn.valid("055£ 444$ 285") should be (false) } test("single zero with space is invalid") { pending Luhn.valid(" 0") should be (false) } test("more than a single zero is valid") { pending Luhn.valid("0000 0") should be (true) } test("input digit 9 is correctly converted to output digit 9") { pending Luhn.valid("091") should be (true) } }
Version data entries
97 entries across 97 versions & 1 rubygems