Skip to content

Commit

Permalink
add test for display of models
Browse files Browse the repository at this point in the history
  • Loading branch information
ablaom committed Sep 25, 2023
1 parent ddd4251 commit 76e4813
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MLJBase"
uuid = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
authors = ["Anthony D. Blaom <[email protected]>"]
version = "1.0.0"
version = "0.21
[deps]
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ include("preliminaries.jl")
@conditional_testset "misc" begin
@test include("utilities.jl")
@test include("static.jl")
@test include("show.jl")
end

@conditional_testset "interface" begin
Expand Down
12 changes: 12 additions & 0 deletions test/show.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@testset "display of models" begin
io = IOBuffer()
show(io, KNNRegressor())
@test String(take!(io)) == "KNNRegressor(K = 5, …)"
show(io, MIME("text/plain"), KNNRegressor())
@test String(take!(io)) ==
"KNNRegressor(\n K = 5, \n algorithm = :kdtree, \n "*
"metric = Distances.Euclidean(0.0), \n leafsize = 10, \n "*
"reorder = true, \n weights = :uniform)"
end

true

0 comments on commit 76e4813

Please sign in to comment.