Sha256: b71a26471198db219eeeb1af720661667e2c84d84b3fda15aedf0d077eab3de5

Contents?: true

Size: 1.09 KB

Versions: 134

Compression:

Stored size: 1.09 KB

Contents

import org.scalatest.{Matchers, FunSuite}

/** @version 1.0.0 */
class GrainsTest extends FunSuite with Matchers {

  test("1") {
    Grains.square(1) should be (Some(1))
  }

  test("2") {
    pending
    Grains.square(2) should be (Some(2))
  }

  test("3") {
    pending
    Grains.square(3) should be (Some(4))
  }

  test("4") {
    pending
    Grains.square(4) should be (Some(8))
  }

  test("16") {
    pending
    Grains.square(16) should be (Some(32768))
  }

  test("32") {
    pending
    Grains.square(32) should be (Some(BigInt("2147483648")))
  }

  test("64") {
    pending
    Grains.square(64) should be (Some(BigInt("9223372036854775808")))
  }

  test("square 0 raises an exception") {
    pending
    Grains.square(0) should be (None)
  }

  test("negative square raises an exception") {
    pending
    Grains.square(-1) should be (None)
  }

  test("square greater than 64 raises an exception") {
    pending
    Grains.square(65) should be (None)
  }

  test("returns the total number of grains on the board") {
    pending
    Grains.total should be (BigInt("18446744073709551615"))
  }
}

Version data entries

134 entries across 134 versions & 1 rubygems

Version Path
trackler-2.2.1.120 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.119 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.118 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.117 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.116 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.115 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.114 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.113 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.111 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.110 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.109 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.108 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.107 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.106 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.105 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.104 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.103 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.102 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.101 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala
trackler-2.2.1.100 tracks/scala/exercises/grains/src/test/scala/GrainsTest.scala