Skip to content

Commit cfc902f

Browse files
committed
Test other branch of map
1 parent c100d50 commit cfc902f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/base.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,12 @@ end
300300
for func in (:reduce, :foldl, :foldr, :mapfoldl, :mapfoldr)
301301
@eval begin
302302
function $func(f, tree::Node; kws...)
303-
throw(error(string($func) * " not implemented for Node. Use `tree_mapreduce` instead."))
303+
throw(
304+
error(
305+
string($func) *
306+
" not implemented for Node. Use `tree_mapreduce` instead.",
307+
),
308+
)
304309
end
305310
end
306311
end

test/test_base.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ end
113113
@test length(unique(map(objectid, copy_node(tree; preserve_sharing=true)))) == 24 - 3
114114
map(t -> (t.degree == 0 && t.constant) ? (t.val *= 2) : nothing, ctree)
115115
@test sum(t -> t.val, filter(t -> t.degree == 0 && t.constant, ctree)) == 11.6 * 2
116+
@test typeof(map(t -> t.degree, ctree, Int)) == Vector{Int}
117+
@test first(map(t -> t.degree, ctree, Int)) == 2
116118
end
117119

118120
@testset "in" begin

0 commit comments

Comments
 (0)