From 87581397cbeaf340d6819edc12d9c9816201a49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Vezy?= Date: Thu, 7 May 2026 16:27:49 +0200 Subject: [PATCH] Fix issue with `descendants(mtg, symbol=:Leaf)` --- src/compute_MTG/check_filters.jl | 1 + test/test-descendants.jl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/compute_MTG/check_filters.jl b/src/compute_MTG/check_filters.jl index 91a01547..c5f9456d 100644 --- a/src/compute_MTG/check_filters.jl +++ b/src/compute_MTG/check_filters.jl @@ -31,6 +31,7 @@ end end @inline normalize_symbol_allowed(filters::Nothing) = nothing +@inline normalize_symbol_allowed(filter) = (normalize_symbol_filter(filter),) @inline function normalize_symbol_allowed(filters::T) where {T<:Union{Tuple,AbstractArray}} map(normalize_symbol_filter, filters) end diff --git a/test/test-descendants.jl b/test/test-descendants.jl index cd0be6e4..35d90405 100644 --- a/test/test-descendants.jl +++ b/test/test-descendants.jl @@ -58,6 +58,8 @@ @test descendants(mtg) == traverse(mtg[1], x -> x) @test descendants(mtg, self=true) == traverse(mtg, x -> x) @test descendants(get_node(mtg, 6), self=true) == [get_node(mtg, 6), get_node(mtg, 7)] + mtg[:symbols] = SubString("Leaf", 1, 4) + @test descendants(mtg, symbol=:Leaf) == [get_node(mtg, 5), get_node(mtg, 7)] out_nodes = typeof(mtg)[] @test descendants!(out_nodes, mtg) == traverse(mtg[1], x -> x)