// ██████╗ █████╗ ███████╗███████╗██╗███╗ ██╗ ██████╗ // ██╔══██╗██╔══██╗██╔════╝██╔════╝██║████╗ ██║██╔════╝ // ██████╔╝███████║███████╗███████╗██║██╔██╗ ██║██║ ███╗ // ██╔═══╝ ██╔══██║╚════██║╚════██║██║██║╚██╗██║██║ ██║ // ██║ ██║ ██║███████║███████║██║██║ ╚████║╚██████╔╝ // ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚═╝╚═╝ ╚═══╝ ╚═════╝ #[cfg(test)] mod passing { use crate::html; #[test] fn meta_content_type() { let html = " "; let dom = html::html_to_dom(&html.as_bytes().to_vec(), str!()); assert_eq!(html::get_charset(&dom.document), Some(str!("GB2312"))); } #[test] fn meta_charset() { let html = " "; let dom = html::html_to_dom(&html.as_bytes().to_vec(), str!()); assert_eq!(html::get_charset(&dom.document), Some(str!("GB2312"))); } #[test] fn multiple_conflicting_meta_charset_first() { let html = " "; let dom = html::html_to_dom(&html.as_bytes().to_vec(), str!()); assert_eq!(html::get_charset(&dom.document), Some(str!("utf-8"))); } #[test] fn multiple_conflicting_meta_content_type_first() { let html = " "; let dom = html::html_to_dom(&html.as_bytes().to_vec(), str!()); assert_eq!(html::get_charset(&dom.document), Some(str!("GB2312"))); } }