281
|
1 |
/*
|
268
|
2 |
def myassert(cond : => Boolean) = {
|
|
3 |
try {
|
|
4 |
assert(cond)
|
|
5 |
} catch {
|
|
6 |
case _ : Throwable => System.exit(1)
|
|
7 |
}
|
|
8 |
}
|
281
|
9 |
*/
|
268
|
10 |
|
281
|
11 |
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2000, 100) == 100)
|
|
12 |
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2001, 100) == 27)
|
|
13 |
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2002, 100) == 42)
|
|
14 |
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2003, 100) == 27)
|
|
15 |
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2004, 100) == 38)
|
|
16 |
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2005, 100) == 113)
|
|
17 |
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2006, 100) == 254)
|
|
18 |
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 2000 to 2007, 100) == 349)
|
|
19 |
assert(CW6b.investment(List("GOOG", "AAPL", "BIDU"), 1990 to 2017, 100) == 11504)
|