]> git.proxmox.com Git - rustc.git/blame - src/librustdoc/html/highlight/tests.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / librustdoc / html / highlight / tests.rs
CommitLineData
1b1a35ee
XL
1use super::write_code;
2use expect_test::expect_file;
3dfed10e
XL
3
4#[test]
1b1a35ee
XL
5fn test_html_highlighting() {
6 let src = include_str!("fixtures/sample.rs");
7 let html = {
8 let mut out = String::new();
9 write_code(&mut out, src);
10 format!("{}<pre><code>{}</code></pre>\n", STYLE, out)
11 };
12 expect_file!["fixtures/sample.html"].assert_eq(&html);
3dfed10e
XL
13}
14
1b1a35ee
XL
15const STYLE: &str = r#"
16<style>
17.kw { color: #8959A8; }
18.kw-2, .prelude-ty { color: #4271AE; }
19.number, .string { color: #718C00; }
20.self, .bool-val, .prelude-val, .attribute, .attribute .ident { color: #C82829; }
21.macro, .macro-nonterminal { color: #3E999F; }
22.lifetime { color: #B76514; }
23.question-mark { color: #ff9011; }
24</style>
25"#;