Skip to content

Commit

Permalink
Merge pull request #41 from tk3369/tk/hotfix-typesof
Browse files Browse the repository at this point in the history
Fix test suite for v0.7
  • Loading branch information
tk3369 committed Mar 11, 2018
2 parents 01e3f40 + 8d83fca commit e1e39f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 0 additions & 3 deletions REQUIRE
Expand Up @@ -2,7 +2,4 @@ julia 0.6
StringEncodings
Missings
Compat
IteratorInterfaceExtensions
TableTraits
TableTraitsUtils
TabularDisplay
17 changes: 13 additions & 4 deletions test/runtests.jl
Expand Up @@ -191,13 +191,22 @@ getmetadata(dir, file; kwargs...) = metadata(getpath(dir, file), kwargs...)
@test typeof(show(md)) == Void
println()

@test SASLib.typesof(Int64) == (Int64,)
@test SASLib.typesof(Union{Int64,Int32}) == (Int64,Int32)
@test SASLib.typesof(Union{Int64,Int32,Missings.Missing}) == (Int64,Int32,Missings.Missing)
# Deal with v0.6/v0.7 difference
# v0.6 shows Missings.Missing
# v0.7 shows Missing
ty(x) = replace(x, "Missings.", "")

# convenient comparison routine since v0.6/v0.7 displays different order
same(x,y) = sort(ty.(string.(collect(x)))) == sort(ty.(string.(collect(y))))

@test same(SASLib.typesof(Int64), (Int64,))
@test same(SASLib.typesof(Union{Int64,Int32}), (Int64,Int32))
@test same(SASLib.typesof(Union{Int64,Int32,Missings.Missing}),
(Int64,Int32,Missings.Missing))

@test SASLib.typesfmt((Int64,)) == "Int64"
@test SASLib.typesfmt((Int64,Int32)) == "Int64/Int32"
@test SASLib.typesfmt((Int64,Int32,Missings.Missing)) == "Int64/Int32/Missings.Missing"
@test ty(SASLib.typesfmt((Int64,Int32,Missings.Missing))) == "Int64/Int32/Missing"
@test SASLib.typesfmt((Int64,Int32); excludemissing=true) == "Int64/Int32"
@test SASLib.typesfmt((Int64,Int32,Missings.Missing); excludemissing=true) == "Int64/Int32"
@test SASLib.colfmt(md)[1] == "ACTUAL(Float64)"
Expand Down

0 comments on commit e1e39f0

Please sign in to comment.