()
| 550 | |
| 551 | #[test] |
| 552 | fn test_append() { |
| 553 | let mut doc = Document::with_capacity(0, 0); |
| 554 | |
| 555 | let node1_id = doc.push_node(new_element()); |
| 556 | let node2_id = doc.push_node(new_element()); |
| 557 | |
| 558 | let document_id = NodeId::document_id(); |
| 559 | doc.append(document_id, node1_id); |
| 560 | doc.append(document_id, node2_id); |
| 561 | |
| 562 | assert_eq!(doc[document_id].last_child, Some(node2_id)); |
| 563 | assert_eq!(doc[node1_id].next_sibling, Some(node2_id)); |
| 564 | assert_eq!(doc[node2_id].previous_sibling, Some(node1_id)); |
| 565 | } |
| 566 | |
| 567 | #[test_case(b"<!DOCTYPE html><html><head><title>Title of the document</title></head><body></body></html>")] |
| 568 | #[test_case(b"<!DOCTYPE html><html><head><title>Title of the document</title></head><body><hr></body></html>")] |
nothing calls this directly
no test coverage detected