Highlight escape sequences in byte strings

This commit is contained in:
yipinliu 2022-03-12 19:00:17 +08:00
parent 36e87fdb98
commit 581e1bf0d7
4 changed files with 97 additions and 18 deletions

View file

@ -476,6 +476,20 @@ fn main() {
);
}
#[test]
fn test_byte_string_highlight() {
check_highlighting(
r#"
fn main() {
let _ = "\x28\x28\x00\x63\n";
let _ = b"\x28\x28\x00\x63\n";
}
"#,
expect_file!["./test_data/highlight_byte_string.html"],
false,
);
}
#[test]
fn test_unsafe_highlighting() {
check_highlighting(