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.1.0.32 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.31 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.30 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.29 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.28 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.27 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.26 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.25 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.24 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.23 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.22 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.21 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.20 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.19 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.18 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.17 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.16 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.15 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.14 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala
trackler-2.1.0.13 tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala