main_marking1/drumb_test3.scala
changeset 424 daf561a83ba6
parent 388 ed63dca8068a
equal deleted inserted replaced
423:e9d14d58be3c 424:daf561a83ba6
     1 /*def myassert(cond : => Boolean) = {
     1 import M1._
     2   try {
     2 
     3     assert(cond)
     3 assert(get_prices(List("BIDU"), 2004 to 2008) ==
     4   } catch { 
       
     5     case _ : Throwable => System.exit(1)
       
     6   }
       
     7 }
       
     8 */
       
     9 assert(CW6b.get_prices(List("BIDU"), 2004 to 2008) ==
       
    10    List(List(None), List(None), List(Some(6.35)), 
     4    List(List(None), List(None), List(Some(6.35)), 
    11         List(Some(12.241)), List(Some(38.188))))
     5         List(Some(12.241)), List(Some(38.188))))
    12 
     6 
    13 
     7 
    14 assert(CW6b.get_prices(List("GOOG", "AAPL"), 2010 to 2012) ==
     8 assert(get_prices(List("GOOG", "AAPL"), 2010 to 2012) ==
    15    List(List(Some(312.204773), Some(26.782711)), 
     9    List(List(Some(312.204773), Some(26.782711)), 
    16         List(Some(301.0466), Some(41.244694)), 
    10         List(Some(301.0466), Some(41.244694)), 
    17         List(Some(331.462585), Some(51.464207))))
    11         List(Some(331.462585), Some(51.464207))))