-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from zengfung/dev
Temporary fix to unit test error
- Loading branch information
Showing
2 changed files
with
50 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,48 @@ | ||
tree = BitVector([1,1,1]) | ||
@test Visualizations.treenodes_matrix(tree) == BitArray([1 1; 1 1]) | ||
# plot_tfbdry() test | ||
p = plot() | ||
@test isa(plot_tfbdry(tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry(p, tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry!(tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry!(p, tree), Plots.Plot{Plots.GRBackend}) | ||
@test_nowarn plot_tfbdry(tree, start=1) | ||
@test_throws AssertionError plot_tfbdry(tree, start=2) | ||
@test_nowarn plot_tfbdry(tree, node_color=:red, background_color=:white, line_color=:black) | ||
# plot_tfbdry2() test | ||
tree = maketree(4,4,2,:dwt) | ||
p = plot() | ||
@test isa(plot_tfbdry2(tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry2(p, tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry2!(tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry2!(p, tree), Plots.Plot{Plots.GRBackend}) | ||
@test_nowarn plot_tfbdry2(tree) | ||
@test_nowarn plot_tfbdry2(tree, 4) | ||
@test_nowarn plot_tfbdry2(tree, 4, 8) | ||
@test_throws AssertionError plot_tfbdry2(tree, 3, 8) | ||
@test_throws AssertionError plot_tfbdry2(tree, 4, 3) | ||
@test_throws AssertionError plot_tfbdry2(tree, 6, 6) | ||
x = randn(16,5) | ||
# wiggle() test | ||
@test typeof(wiggle(x)) == Plots.Plot{Plots.GRBackend} | ||
p = plot() | ||
@test typeof(wiggle(p, x)) == Plots.Plot{Plots.GRBackend} | ||
# wiggle!() test | ||
@test typeof(wiggle!(x)) == Plots.Plot{Plots.GRBackend} | ||
@test typeof(wiggle!(p, x)) == Plots.Plot{Plots.GRBackend} | ||
@test_throws ErrorException("Inconsistent taxis dimension!") wiggle!(p, x, taxis=1:5) | ||
@test_throws ErrorException("Inconsistent zaxis dimension!") wiggle!(p, x, zaxis=1:4) | ||
@test_nowarn wiggle!(p, x, sc=0.3) | ||
@test_nowarn wiggle!(p, x, EdgeColor=:red) | ||
@test_nowarn wiggle!(p, x, FaceColor=:red) | ||
@test_nowarn wiggle!(p, x, Overlap=false) | ||
@test_nowarn wiggle!(p, x, Orient=:down) | ||
@test_throws AssertionError wiggle!(p, x, Orient=:fail) | ||
@test_nowarn wiggle!(p, x, ZDir=:reverse) | ||
@test_throws AssertionError wiggle!(p, x, ZDir=:fail) | ||
@testset "plot_tfbdry" begin | ||
tree = BitVector([1,1,1]) | ||
@test Visualizations.treenodes_matrix(tree) == BitArray([1 1; 1 1]) | ||
p = plot() | ||
@test isa(plot_tfbdry(tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry(p, tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry!(tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry!(p, tree), Plots.Plot{Plots.GRBackend}) | ||
@test_nowarn plot_tfbdry(tree, start=1) | ||
@test_throws AssertionError plot_tfbdry(tree, start=2) | ||
@test_nowarn plot_tfbdry(tree, node_color=:red, background_color=:white, line_color=:black) | ||
end | ||
|
||
@testset "plot_tfbdry2" begin | ||
tree = maketree(4,4,2,:dwt) | ||
p = plot() | ||
@test isa(plot_tfbdry2(tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry2(p, tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry2!(tree), Plots.Plot{Plots.GRBackend}) | ||
@test isa(plot_tfbdry2!(p, tree), Plots.Plot{Plots.GRBackend}) | ||
@test_nowarn plot_tfbdry2(tree) | ||
@test_nowarn plot_tfbdry2(tree, 4) | ||
@test_nowarn plot_tfbdry2(tree, 4, 8) | ||
@test_throws AssertionError plot_tfbdry2(tree, 3, 8) | ||
@test_throws AssertionError plot_tfbdry2(tree, 4, 3) | ||
@test_throws AssertionError plot_tfbdry2(tree, 6, 6) | ||
end | ||
|
||
@testset "wiggle" begin | ||
x = randn(16,5) | ||
# wiggle() test | ||
@test typeof(wiggle(x)) == Plots.Plot{Plots.GRBackend} | ||
p = plot() | ||
@test typeof(wiggle(p, x)) == Plots.Plot{Plots.GRBackend} | ||
# wiggle!() test | ||
@test typeof(wiggle!(x)) == Plots.Plot{Plots.GRBackend} | ||
@test typeof(wiggle!(p, x)) == Plots.Plot{Plots.GRBackend} | ||
@test_throws ErrorException("Inconsistent taxis dimension!") wiggle!(p, x, taxis=1:5) | ||
@test_throws ErrorException("Inconsistent zaxis dimension!") wiggle!(p, x, zaxis=1:4) | ||
@test_nowarn wiggle!(p, x, sc=0.3) | ||
@test_nowarn wiggle!(p, x, EdgeColor=:red) | ||
@test_nowarn wiggle!(p, x, FaceColor=:red) | ||
@test_nowarn wiggle!(p, x, Overlap=false) | ||
@test isa(wiggle!(p, x, Orient=:down), Plots.Plot{Plots.GRBackend}) # TODO: Keyword plot(orientation) deprecated. Figure out long term solution to this. | ||
@test_throws AssertionError wiggle!(p, x, Orient=:fail) | ||
@test_nowarn wiggle!(p, x, ZDir=:reverse) | ||
@test_throws AssertionError wiggle!(p, x, ZDir=:fail) | ||
end |