Skip to content

Commit

Permalink
Added Tables-specific test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tk3369 committed Jan 2, 2020
1 parent eb1d5ba commit 7191e98
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using SASLib
using Dates
using Statistics: mean
using SharedArrays: SharedArray
using Tables

function getpath(dir, file)
path = joinpath(dir, file)
Expand Down Expand Up @@ -222,6 +223,13 @@ Base.convert(::Type{YearStr}, v::Float64) = YearStr(string(round(Int, v)))
# Tables.jl interface - getproperty test
@test rs.ACTUAL == rs[:ACTUAL]
@test names(rs) == propertynames(rs)

# Tables.jl coverage
@test Tables.schema(rs).names == Tuple(names(rs))
@test Tables.schema(rs).types == Tuple(eltype.([rs[s] for s in names(rs)]))
@test length(Tables.rowtable(rs)) == 1440
@test length(Tables.columntable(rs)) == 10
@test size(Tables.matrix(rs[:ACTUAL, :PREDICT])) == (1440,2)
end

@testset "metadata" begin
Expand Down

0 comments on commit 7191e98

Please sign in to comment.