Sha256: c71f8142cf8ea7697c5750fcba5cfefed4ce6b5bb136c61103f92a3ba9632d77

Contents?: true

Size: 725 Bytes

Versions: 163

Compression:

Stored size: 725 Bytes

Contents

import org.scalatest.{FunSuite, Matchers}

class LuhnTest extends FunSuite with Matchers {
  test("single digit strings can not be valid") {
    Luhn.validate("1") should be (false)
  }

  test("A single zero is invalid") {
    pending
    Luhn.validate("0") should be (false)
  }

  test("valid Canadian SIN") {
    pending
    Luhn.validate("046 454 286") should be (true)
  }

  test("invalid Canadian SIN") {
    pending
    Luhn.validate("046 454 287") should be (false)
  }

  test("invalid credit card") {
    pending
    Luhn.validate("8273 1232 7352 0569") should be (false)
  }

  test("strings that contain non-digits are not valid") {
    pending
    Luhn.validate("827a 1232 7352 0569") should be (false)
  }
}

Version data entries

163 entries across 163 versions & 1 rubygems

Version Path
trackler-2.2.1.10 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.1.9 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.1.8 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.1.7 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.1.6 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.1.5 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.1.4 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.1.3 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.1.2 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.1.1 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.1.0 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.0.6 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.0.5 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.0.4 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.0.3 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.0.2 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.0.1 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.2.0.0 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.55 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.54 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala