Diff
Logged in as anonymous

Differences From Artifact [132c411fd8]:

To Artifact [e383e9fd77]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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, html);
	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>";











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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, "&lt;p&gt;Some &lt;b&gt;valid&lt;/b&gt; HTML&lt;/p&gt;");
	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>";