提交 ee381167 编写于 作者: G Guillaume Gomez

Add test for union keyword highlighting

上级 47c50560
<span class="kw">union</span> <span class="ident">Foo</span> {
<span class="ident">i</span>: <span class="ident">i8</span>,
<span class="ident">u</span>: <span class="ident">i8</span>,
}
<span class="kw">fn</span> <span class="ident">main</span>() {
<span class="kw">let</span> <span class="ident">union</span> <span class="op">=</span> <span class="number">0</span>;
}
union Foo {
i: i8,
u: i8,
}
fn main() {
let union = 0;
}
......@@ -54,3 +54,13 @@ fn test_keyword_highlight() {
expect_file!["fixtures/highlight.html"].assert_eq(&html.into_inner());
});
}
#[test]
fn test_union_highlighting() {
create_default_session_globals_then(|| {
let src = include_str!("fixtures/union.rs");
let mut html = Buffer::new();
write_code(&mut html, src, Edition::Edition2018, None);
expect_file!["fixtures/union.html"].assert_eq(&html.into_inner());
});
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册