Skip to content

Commit

Permalink
added missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oheil committed Mar 25, 2018
1 parent a156099 commit 1bb8367
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,33 @@ r[4]=0
r=[ Int(x) for x in r ]
@test r==Array{Int}([1,2,5,0,3])

testfloat = [ 2.0 2.0 8.0 0.0 7.0 ]
a=Array{Union{Missing, Float64}}(undef,(size(testfloat,1),size(testfloat,2)));
a[:]=testfloat[:]
a[4]=missing
(r,m)=sampleRanks(a,tiesMethod=tmMax,naIncreasesRank=false,resultMatrix=true)
r[4]=0
r=[ Int(x) for x in r ]
@test r==Array{Int}([2,2,4,0,3])

testfloat = [ 2.0 2.0 8.0 0.0 7.0 ]
a=Array{Union{Missing, Float64}}(undef,(size(testfloat,1),size(testfloat,2)));
a[:]=testfloat[:]
a[4]=missing
(r,m)=sampleRanks(a,tiesMethod=tmRandom,naIncreasesRank=false,resultMatrix=true)
r[4]=0
r=[ Int(x) for x in r ]
@test r==Array{Int}([1,2,4,0,3]) || r==Array{Int}([2,1,4,0,3])

testfloat = [ 2.0 2.0 8.0 0.0 7.0 ]
a=Array{Union{Missing, Float64}}(undef,(size(testfloat,1),size(testfloat,2)));
a[:]=testfloat[:]
a[4]=missing
(r,m)=sampleRanks(a,tiesMethod=tmAverage,naIncreasesRank=false,resultMatrix=true)
r[4]=0
r=[ Int(x) for x in r ]
@test r==Array{Int}([2,2,4,0,3])

testfloat = [ 2.0 2.0 8.0 0.0 7.0 ]
a=Array{Union{Missing, Float64}}(undef,(size(testfloat,1),size(testfloat,2)));
a[:]=testfloat[:]
Expand Down Expand Up @@ -288,3 +315,5 @@ a[3]=missing
@test r[12]==12




0 comments on commit 1bb8367

Please sign in to comment.