Skip to content

Commit

Permalink
Add more tests for Grouping
Browse files Browse the repository at this point in the history
  • Loading branch information
dmbates committed Mar 1, 2021
1 parent 5be2c4f commit d5b23cc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/grouping.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
using Test
using StatsModels

@testset "Grouping" begin
g = Grouping()
@test isnothing(g.levels)
end

@testset "Grouping pseudo-contrasts" begin
d = (y = rand(2_000_000), grp=string.([1:1_000_000; 1:1_000_000]))
## OOM seems to result in the process being killed on Mac so this messes up CI
Expand All @@ -10,6 +15,7 @@ using StatsModels
@test t isa CategoricalTerm{Grouping}
@test size(t.contrasts.matrix) == (0,0)
@test length(t.contrasts.levels) == 1_000_000
@test_throws ErrorException StatsModels.modelcols(t, (a = 1.,))

levs = sort(string.(1:1_000_000))

Expand Down

0 comments on commit d5b23cc

Please sign in to comment.