]> gitweb.factorcode.org Git - factor.git/commitdiff
math.finance: adding some tests.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 4 May 2012 17:06:24 +0000 (10:06 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 4 May 2012 17:06:24 +0000 (10:06 -0700)
extra/math/finance/finance-tests.factor

index eb4b238f6157416ca30f3a1bf0124b5dea77485e..0d14bcb6d39142d30294ac722c9e29d1e1fcf706 100644 (file)
@@ -1,11 +1,21 @@
-USING: kernel math math.functions math.finance tools.test ;
+USING: kernel math math.functions math.finance sequences
+tools.test ;
 
 IN: math.finance.tests
 
-[ { 1 2 3 4 } ] [ { 1 2 3 4 5 } 1 ema ] unit-test
+[ { 1 2 3 4 5 } ] [ { 1 2 3 4 5 } 1 ema ] unit-test
+[ { 1+1/2 2+1/2 3+1/2 4+1/2 } ] [ { 1 2 3 4 5 } 2 ema ] unit-test
+[ { 2 3 4 } ] [ { 1 2 3 4 5 } 3 ema ] unit-test
 
 [ { 2 4 } ] [ { 1 3 5 } 2 sma ] unit-test
 
+[ { 2 3 4 5 } ] [ 6 iota 2 dema ] unit-test
+
+[ t ] [ 6 iota 2 [ dema ] [ 1 gdema ] 2bi = ] unit-test
+
+[ { 3 4 5 } ] [ 6 iota 2 tema ] unit-test
+[ { 6 7 8 9 } ] [ 10 iota 3 tema ] unit-test
+
 [ { 1 3 1 } ] [ { 1 3 2 6 3 } 2 momentum ] unit-test
 
 [ 4+1/6 ] [ 100 semimonthly ] unit-test