marking1/drumb_test2.scala
changeset 169 b37052895281
parent 158 94b11ac19b41
child 170 37b1bfcdba79
--- a/marking1/drumb_test2.scala	Tue Jan 16 10:47:29 2018 +0000
+++ b/marking1/drumb_test2.scala	Fri Jan 19 14:09:08 2018 +0000
@@ -1,36 +1,12 @@
-//println("starting test now")
 
-/*
-import scala.concurrent._
-import scala.concurrent.duration._
-import ExecutionContext.Implicits.global
-import scala.language.postfixOps 
-
-val urban_prices = List(List(Some(71.539941), None), 
-                        List(Some(76.974614), None), 
-                        List(Some(65.226685), Some(6.35)), 
-                        List(Some(78.354649), Some(12.241)), 
-                        List(Some(85.517645), Some(38.188)))
-
-val urban_deltas = List(List(Some(0.07596697626574789), None), 
-                        List(Some(-0.152620823795232), None), 
-                        List(Some(0.20126676681483952), Some(0.9277165354330709)), 
-                        List(Some(0.09141762603007778), Some(2.119679764725104)))
+val urban_prices1 = CW6c.get_prices(List("BIDU"), 2004 to 2008)
+val urban_prices2 = CW6c.get_prices(List("GOOG", "AAPL"), 2010 to 2012)
 
 
-lazy val f = Future {
-  //assert(get_deltas(urban_prices) == urban_deltas)
-  assert (get_deltas(get_prices(List("IBM", "BIDU"), 2004 to 2008)) == urban_deltas)
-}
-
-
-Await.result(f, 180 second)
+assert(CW6c.get_deltas(urban_prices1) == 
+       List(List(None), List(None), 
+	    List(Some(0.9277165354330709)), List(Some(2.119679764725104))))
 
-*/
-
-val urban_prices = List(List(Some(311.349976), Some(27.505054)), 
-			List(Some(300.222351), Some(42.357094)), 
-			List(Some(330.555054), Some(52.852215)))
-
-assert(CW6c.get_deltas(urban_prices) == List(List(Some(-0.03573992567129673), Some(0.5399749442411563)), 
-                                             List(Some(0.10103412653643493), Some(0.2477771728154912))))
+assert(CW6c.get_deltas(urban_prices2) == 
+       List(List(Some(-0.03573992567129673), Some(0.5399749442411563)), 
+	    List(Some(0.10103412653643493), Some(0.2477771728154912))))