diff --git a/rslib/src/tags/reparent.rs b/rslib/src/tags/reparent.rs index 40755f15a..5512bed7a 100644 --- a/rslib/src/tags/reparent.rs +++ b/rslib/src/tags/reparent.rs @@ -97,7 +97,7 @@ fn reparented_name(existing_name: &str, new_parent: Option<&str>) -> Option no-op None } else { @@ -233,6 +233,25 @@ mod test { ] ); + // grandchildren can be reparented under the same root + col.reparent_tags( + &["parent2::child1::grandchild1".to_string()], + Some("parent2".to_string()), + )?; + + assert_eq!( + alltags(&col), + &[ + "ab", + "ab::a", + "another", + "parent1", + "parent2", + "parent2::child1", + "parent2::grandchild1", + ] + ); + Ok(()) } }