File src/tests.rs artifact e383e9fd77 part of check-in 1c10bccb4e
use crate::utils::validate; use stacked_errors::{ Result, StackableErr, }; #[test] fn check_valid () -> Result<()> { let html = "<p>Some <b>valid</b> HTML</p>"; let res = validate(html).stack()?; assert_eq!(res, "<p>Some <b>valid</b> HTML</p>"); Ok(()) } #[test] #[should_panic = "Telegram closing tag found."] fn check_invalid () { let html = "<p>Some <b>valid</b> HTML</p></code><a href='http://somewere.com'>Link injection!</a>"; let _ = validate(html).unwrap(); }