marking1/drumb_test1.scala
changeset 267 9e0216756771
parent 210 63a1376cbebd
child 281 87b9e3e2c1a7
--- a/marking1/drumb_test1.scala	Wed Jul 24 14:22:06 2019 +0100
+++ b/marking1/drumb_test1.scala	Wed Jul 24 15:18:44 2019 +0100
@@ -1,21 +1,12 @@
-
-
-assert(get_january_data("GOOG", 1980) == List())
-
-assert(get_january_data("GOOG", 2010).head == "2010-01-04,311.349976")
-
-
-
+def myassert(cond : => Boolean) = {
+  try {
+    assert(cond)
+  } catch { 
+    case _ : Throwable => System.exit(1)
+  }
+}
 
-/*
-assert(CW6c.get_prices(List("BIDU"), 2004 to 2008) == 
-       List(List(None), List(None), 
-            List(Some(6.35)), List(Some(12.241)), 
-            List(Some(38.188))))
+myassert(get_january_data("GOOG", 1980) == List())
 
+myassert(get_january_data("GOOG", 2010).head == "2010-01-04,312.204773")
 
-assert(CW6c.get_prices(List("GOOG", "AAPL"), 2010 to 2012) ==
-       List(List(Some(311.349976), Some(27.505054)), 
-            List(Some(300.222351), Some(42.357094)), 
-            List(Some(330.555054), Some(52.852215))))
-*/