marking1/drumb_test1.scala
author Christian Urban <urbanc@in.tum.de>
Wed, 24 Jul 2019 15:18:44 +0100
changeset 267 9e0216756771
parent 210 63a1376cbebd
child 281 87b9e3e2c1a7
permissions -rw-r--r--
updated myassert workaround
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
267
9e0216756771 updated myassert workaround
Christian Urban <urbanc@in.tum.de>
parents: 210
diff changeset
     1
def myassert(cond : => Boolean) = {
9e0216756771 updated myassert workaround
Christian Urban <urbanc@in.tum.de>
parents: 210
diff changeset
     2
  try {
9e0216756771 updated myassert workaround
Christian Urban <urbanc@in.tum.de>
parents: 210
diff changeset
     3
    assert(cond)
9e0216756771 updated myassert workaround
Christian Urban <urbanc@in.tum.de>
parents: 210
diff changeset
     4
  } catch { 
9e0216756771 updated myassert workaround
Christian Urban <urbanc@in.tum.de>
parents: 210
diff changeset
     5
    case _ : Throwable => System.exit(1)
9e0216756771 updated myassert workaround
Christian Urban <urbanc@in.tum.de>
parents: 210
diff changeset
     6
  }
9e0216756771 updated myassert workaround
Christian Urban <urbanc@in.tum.de>
parents: 210
diff changeset
     7
}
210
63a1376cbebd updated
Christian Urban <urbanc@in.tum.de>
parents: 169
diff changeset
     8
267
9e0216756771 updated myassert workaround
Christian Urban <urbanc@in.tum.de>
parents: 210
diff changeset
     9
myassert(get_january_data("GOOG", 1980) == List())
169
b37052895281 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    10
267
9e0216756771 updated myassert workaround
Christian Urban <urbanc@in.tum.de>
parents: 210
diff changeset
    11
myassert(get_january_data("GOOG", 2010).head == "2010-01-04,312.204773")
169
b37052895281 updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    12