Skip to content

Commit

Permalink
Run statquiz as part fo tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Oct 12, 2015
1 parent cf94391 commit ada4b06
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ notifications:
email: false
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia --check-bounds=yes -e 'Pkg.clone(pwd()); Pkg.build("StatsBase"); Pkg.test("StatsBase"; coverage=true)'
- julia --check-bounds=yes -e 'Pkg.clone(pwd())'
- julia --check-bounds=yes -e 'Pkg.add("DataFrames")'
- julia --check-bounds=yes -e 'Pkg.add("GLM")'
- julia --check-bounds=yes -e 'Pkg.test("StatsBase"; coverage=true)'
after_success:
- julia -e 'cd(Pkg.dir("StatsBase")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
3 changes: 2 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ tests = ["weights",
"misc",
"sampling",
"wsampling",
"statmodels"]
"statmodels",
"statquiz"]

println("Running tests:")

Expand Down
16 changes: 8 additions & 8 deletions test/statquiz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ using GLM
testeps = sqrt(eps())

nasty = DataFrame( label = ["One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"],
x = [1.:9],
x = collect(1.:9),
zero = fill(0.0,9),
miss = fill(NA, 9),
big = 99999990.0 + [1:9;],
little = (99999990.0 + [1:9;])/10^8,
huge = [1.:9;]*1e12,
tiny = [1.:9;]*1e-12,
round = [0.5:8.5])
big = 99999990.0 + collect(1:9),
little = (99999990.0 + collect(1:9))/10^8,
huge = collect(1.:9)*1e12,
tiny = collect(1.:9)*1e-12,
round = collect(0.5:8.5))

println(nasty)
println("\nII Real Numbers:\nII A")
Expand Down Expand Up @@ -48,7 +48,7 @@ println("OK")

println("\nII D")
print("Test correlation: ")
cn = names(nasty)[[2,5:9]]
cn = names(nasty)[[2;5:9]]
for i in 1:5
for j = i+1:6
@test_approx_eq cor(nasty[cn[i]], nasty[cn[j]]) 1
Expand All @@ -57,7 +57,7 @@ end
println("OK")

print("Test spearman correlation: ")
cn = names(nasty)[[2,5:9]]
cn = names(nasty)[[2;5:9]]
for i in 1:5
for j = i+1:6
@test_approx_eq corspearman(nasty[cn[i]], nasty[cn[j]]) 1
Expand Down

0 comments on commit ada4b06

Please sign in to comment.