marking1/drumb_test7.scala
author Christian Urban <urbanc@in.tum.de>
Sat, 02 Nov 2019 12:06:07 +0000
changeset 303 b4c597be7514
parent 281 87b9e3e2c1a7
child 331 e3878cdd38bc
permissions -rw-r--r--
updated

/*
def myassert(cond : => Boolean) = {
  try {
    assert(cond)
  } catch { 
    case _ : Throwable => System.exit(1)
  }
}
*/

assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2000, 100) == 100)
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2001, 100) == 27)
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2002, 100) == 42)
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2003, 100) == 27)
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2004, 100) == 38)
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2005, 100) == 113)
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2006, 100) == 254)
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2007, 100) == 349)
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 1990 to 2017, 100) == 11504)