test(promql): read a tree line by the node it names

The composition test looked for a path prefix in front of the node name, which
the bracketed tree no longer prints; the node name itself is the first word of
every line.

Signed-off-by: discord9 <discord9@163.com>
This commit is contained in:
discord9
2026-11-12 19:45:53 +08:00
parent ffc2f0dc28
commit 1e0c0084cd
+3 -3
View File
@@ -5909,9 +5909,9 @@ async fn native_histogram_composition_query(
assert!(
descriptions.iter().any(|description| {
description.lines().any(|line| {
let mut words = line.split_whitespace();
matches!(words.next(), Some("root" | "input" | "left" | "right"))
&& words.next() == Some("Binary")
// A tree line names its node first, so a `Binary` line is a binary node wherever it
// sits in the tree.
matches!(line.split_whitespace().next(), Some("Binary" | "Binary:"))
})
}),
"`{query}` did not execute a native Binary: {descriptions:?}; response: {body}"