MCPcopy Create free account
hub / github.com/Stranger6667/css-inline / test_serialize

Function test_serialize

css-inline/src/html/serializer.rs:823–843  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

821
822 #[test]
823 fn test_serialize() {
824 let doc = Document::parse_with_options(
825 b"<html><head><style>h1 { color:blue; }</style><style>h1 { color:red }</style></head>",
826 0,
827 InliningMode::Document,
828 );
829 let mut buffer = Vec::new();
830 doc.serialize(
831 &mut buffer,
832 vec![None; doc.nodes.len()],
833 true,
834 false,
835 false,
836 None,
837 InliningMode::Document,
838 false,
839 false,
840 )
841 .expect("Should not fail");
842 assert_eq!(buffer, b"<html><head><style>h1 { color:blue; }</style><style>h1 { color:red }</style></head><body></body></html>");
843 }
844
845 #[test]
846 fn test_skip_style_tags() {

Callers

nothing calls this directly

Calls 2

parse_with_optionsFunction · 0.85
serializeMethod · 0.45

Tested by

no test coverage detected