Skip to content

Commit 47e9c67

Browse files
committed
Fix field type in unittest
1 parent ad97847 commit 47e9c67

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/base.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ julia> tree_mapreduce(t -> 1, (p, c...) -> p + max(c...), tree) # compute depth
5252
5
5353
5454
julia> tree_mapreduce(vcat, tree) do t
55-
t.degree == 2 ? [t.op] : Int8[]
55+
t.degree == 2 ? [t.op] : UInt8[]
5656
end # Get list of binary operators used. (regular mapreduce also works)
57-
2-element Vector{Int8}:
57+
2-element Vector{UInt8}:
5858
1
5959
2
6060

test/test_base.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ end
114114
@test length(unique(map(objectid, copy_node(tree; preserve_sharing=true)))) == 24 - 3
115115
map(t -> (t.degree == 0 && t.constant) ? (t.val *= 2) : nothing, ctree)
116116
@test sum(t -> t.val, filter(t -> t.degree == 0 && t.constant, ctree)) == 11.6 * 2
117-
@test typeof(map(t -> t.degree, ctree, Int8)) == Vector{Int8}
118-
@test first(map(t -> t.degree, ctree, Int8)) == 2
117+
local T = fieldtype(typeof(ctree), :degree)
118+
@test typeof(map(t -> t.degree, ctree, T)) == Vector{T}
119+
@test first(map(t -> t.degree, ctree, T)) == 2
119120
end
120121

121122
@testset "in" begin

0 commit comments

Comments
 (0)