Added another test for menu_tree.

This commit is contained in:
vorboyvo 2025-09-25 13:30:24 -04:00
parent 6f6ef15342
commit 135e166c91

View file

@ -174,3 +174,15 @@ fn test_menu_complex() {
assert_eq!(a_menu_tree, b) assert_eq!(a_menu_tree, b)
} }
#[test]
fn test_menu_cascading() {
let (_, a) = parser::tree("([1.0]A[0.5]([1.0]B[2.5]([1.3]C[1.4]D)))").unwrap();
let (_, b) = parser::tree("([1.0]A[4.4]D)").unwrap();
let Some((a_menu_tree, _)) = a.menu_tree(&[
"A".to_owned(), "D".to_owned()
]) else {
panic!("Failed to get tree from menu_tree output")
};
assert_eq!(a_menu_tree, b)
}