diff --git a/test/runtests.jl b/test/runtests.jl index 3dae748..36118dc 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,7 +4,9 @@ using Base.Test const N = 1_000 const X0 = 50.0 +const seed = 1 +srand(seed) x = cumsum(randn(N)) + X0 ohlc = cumsum(randn(N,4)) + X0 hlc = ohlc[:,2:4] @@ -12,8 +14,14 @@ hl = ohlc[:,2:3] count_nans(x) = sum(isnan.(x)) -#TODO: trendy.jl -#TODO: utils.jl +@testset "Utilities" begin + y = x + randn(N) + cxo = crossover(x, y) + cxu = crossunder(x, y) + @test any(cxo) + @test any(cxu) + @test !any(cxo .* cxu) # ensure crossovers and crossunders never coincide +end # trendy @testset "Trendlines" begin @@ -79,7 +87,6 @@ end @test count_nans(tmp) != N end -#TODO: run.jl @testset "Running Calculations" begin tmp = diffn(x) @test size(tmp, 1) == N