Skip to content

Commit

Permalink
Fix tests (#91)
Browse files Browse the repository at this point in the history
* Fix tests

* add tests for chars and pairs

* change to test-broken

Co-authored-by: oscarddssmith <[email protected]>
  • Loading branch information
oscardssmith and oscardssmith authored Feb 1, 2022
1 parent 4ab37fc commit 84d2a28
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 7 additions & 2 deletions test/builtins.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ using Test
@test intree(tree, tree)


tree2 = Any[Any[1,2],Any[3,4]]
@test collect(PreOrderDFS(tree2)) == Any[tree2,Any[1,2],1,2,Any[3,4],3,4]
tree2 = Any[Any[1,2],Any[3,'4']]
@test collect(PreOrderDFS(tree2)) == Any[tree2,Any[1,2],1,2,Any[3,'4'],3,'4']

@test treesize(tree2) == 7
@test treebreadth(tree2) == 4
Expand All @@ -63,6 +63,11 @@ using Test
end


@testset "Pair" begin
tree = 1=>(3=>4)
@test collect(PreOrderDFS(tree)) == Any[tree, tree.second, 4]
end

@testset "Expr" begin
expr = :(foo(x^2 + 3))

Expand Down
8 changes: 6 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ using Test
import Base: ==


if VERSION >= v"1.1.0-DEV.838" # requires https://github.com/JuliaLang/julia/pull/30291
if v"1.1.0" < VERSION # requires https://github.com/JuliaLang/julia/pull/30291
@testset "Ambiguities" begin
@test isempty(detect_ambiguities(AbstractTrees, Base, Core))
if VERSION < v"1.8-"
@test isempty(detect_ambiguities(AbstractTrees, Base, Core))
else
@test_broken isempty(detect_ambiguities(AbstractTrees, Base, Core))
end
end
end

Expand Down

0 comments on commit 84d2a28

Please sign in to comment.