mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
add a test for an issue with namespace propagation
This commit is contained in:
parent
0a45a6993e
commit
9a00c998ae
1 changed files with 11 additions and 0 deletions
11
src/lib.rs
11
src/lib.rs
|
@ -672,4 +672,15 @@ mod tests {
|
|||
assert_eq!(root.get_child("child", "root_ns").unwrap().attr("c"), Some("d"));
|
||||
assert_eq!(root.get_child("child", "child_ns").unwrap().attr("d"), Some("e"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn namespace_propagation_works() {
|
||||
let mut root = Element::builder("root").ns("root_ns").build();
|
||||
let mut child = Element::bare("child");
|
||||
let grandchild = Element::bare("grandchild");
|
||||
child.append_child(grandchild);
|
||||
root.append_child(child);
|
||||
assert_eq!(root.get_child("child", "root_ns").unwrap().ns(), root.ns());
|
||||
assert_eq!(root.get_child("grandchild", "root_ns").unwrap().ns(), root.ns());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue