mirror of
https://github.com/askama-rs/askama.git
synced 2025-09-30 22:41:13 +00:00
Fix formatting with cargo fmt
This commit is contained in:
parent
3fdf1c7a37
commit
ec2e873d73
@ -155,14 +155,23 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_linebreaks() {
|
||||
assert_eq!(linebreaks(&"Foo\nBar Baz").unwrap(), "<p>Foo<br/>Bar Baz</p>");
|
||||
assert_eq!(linebreaks(&"Foo\nBar\n\nBaz").unwrap(), "<p>Foo<br/>Bar</p><p>Baz</p>");
|
||||
assert_eq!(
|
||||
linebreaks(&"Foo\nBar Baz").unwrap(),
|
||||
"<p>Foo<br/>Bar Baz</p>"
|
||||
);
|
||||
assert_eq!(
|
||||
linebreaks(&"Foo\nBar\n\nBaz").unwrap(),
|
||||
"<p>Foo<br/>Bar</p><p>Baz</p>"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_linebreaksbr() {
|
||||
assert_eq!(linebreaksbr(&"Foo\nBar").unwrap(), "Foo<br/>Bar");
|
||||
assert_eq!(linebreaksbr(&"Foo\nBar\n\nBaz").unwrap(), "Foo<br/>Bar<br/><br/>Baz");
|
||||
assert_eq!(
|
||||
linebreaksbr(&"Foo\nBar\n\nBaz").unwrap(),
|
||||
"Foo<br/>Bar<br/><br/>Baz"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -37,10 +37,22 @@ fn teams(b: &mut criterion::Bencher) {
|
||||
let teams = Teams {
|
||||
year: 2015,
|
||||
teams: vec![
|
||||
Team { name: "Jiangsu".into(), score: 43 },
|
||||
Team { name: "Beijing".into(), score: 27 },
|
||||
Team { name: "Guangzhou".into(), score: 22 },
|
||||
Team { name: "Shandong".into(), score: 12 },
|
||||
Team {
|
||||
name: "Jiangsu".into(),
|
||||
score: 43,
|
||||
},
|
||||
Team {
|
||||
name: "Beijing".into(),
|
||||
score: 27,
|
||||
},
|
||||
Team {
|
||||
name: "Guangzhou".into(),
|
||||
score: 22,
|
||||
},
|
||||
Team {
|
||||
name: "Shandong".into(),
|
||||
score: 12,
|
||||
},
|
||||
],
|
||||
};
|
||||
b.iter(|| teams.render().unwrap());
|
||||
|
Loading…
x
Reference in New Issue
Block a user