testing1/drumb_test7.scala
author Christian Urban <urbanc@in.tum.de>
Fri, 22 Nov 2019 17:01:55 +0000
changeset 324 2969ee4a6cee
parent 281 87b9e3e2c1a7
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
281
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     1
/*
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     2
def myassert(cond : => Boolean) = {
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     3
  try {
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     4
    assert(cond)
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     5
  } catch { 
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     6
    case _ : Throwable => System.exit(1)
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     7
  }
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     8
}
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
     9
*/
130
7f3f01dfe738 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
281
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    11
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2000, 100) == 100)
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    12
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2001, 100) == 27)
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    13
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2002, 100) == 42)
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    14
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2003, 100) == 27)
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    15
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2004, 100) == 38)
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    16
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    17
// 113
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    18
assert((112 to 114).contains(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2005, 100)))
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    19
// 254
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    20
assert((252 to 256).contains(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2006, 100)))
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    21
// 349
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    22
assert((346 to 352).contains(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2007, 100)))
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    23
//11504
87b9e3e2c1a7 updated
Christian Urban <urbanc@in.tum.de>
parents: 248
diff changeset
    24
assert((11389 to 11619).contains(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 1990 to 2017, 100)))