marking1/collatz_test1.scala
author Christian Urban <urbanc@in.tum.de>
Wed, 24 Jul 2019 15:18:44 +0100
changeset 267 9e0216756771
parent 266 ca48ac1d3c3e
child 281 87b9e3e2c1a7
permissions -rw-r--r--
updated myassert workaround


def myassert(cond : => Boolean) = {
  try {
    assert(cond)
  } catch { 
    case _ : Throwable => System.exit(1)
  }
}

myassert(collatz(1) == 0)
myassert(collatz(6) == 8)
myassert(collatz(9) == 19)
myassert(collatz(9000) == 47)