changeset 268 | e43f7e92ba26 |
parent 210 | 63a1376cbebd |
child 281 | 87b9e3e2c1a7 |
--- a/marking1/drumb_test2.scala Wed Jul 24 15:18:44 2019 +0100 +++ b/marking1/drumb_test2.scala Thu Aug 01 09:48:34 2019 +0100 @@ -1,5 +1,12 @@ - -assert(get_first_price("GOOG", 1980) == None) +def myassert(cond : => Boolean) = { + try { + assert(cond) + } catch { + case _ : Throwable => System.exit(1) + } +} -assert(get_first_price("GOOG", 2010) == Some(311.349976)) +myassert(get_first_price("GOOG", 1980) == None) +myassert(get_first_price("GOOG", 2010) == Some(312.204773)) +