Update tests

This commit is contained in:
Jonathan Schear 2024-03-22 14:24:44 -07:00
parent 723c390f52
commit ab4a5343a0
No known key found for this signature in database
GPG key ID: 0F4D841667534076
5 changed files with 27 additions and 12 deletions

View file

@ -413,7 +413,7 @@ mod tests {
#[test]
fn test_highlight_doc_comments() {
let text = "## a\n##b\n##c";
let text = "## a\n##b\n##c\n##\n";
let tokens = highlight(text);
assert_eq!(
tokens,
@ -422,14 +422,17 @@ mod tests {
Region::between(Position::new(0), Position::new(4)),
Token::DocComment
),
// the next two are line comments because there's not a space at the beginning
Loc::at(
Region::between(Position::new(5), Position::new(8)),
Token::LineComment
Token::DocComment
),
Loc::at(
Region::between(Position::new(9), Position::new(12)),
Token::LineComment
Token::DocComment
),
Loc::at(
Region::between(Position::new(13), Position::new(15)),
Token::DocComment
),
]
);

View file

@ -0,0 +1,8 @@
#######
### not docs!
## actually docs
##
######
x = 5
42

View file

@ -5,7 +5,7 @@ SpaceBefore(
Index(2147483648),
],
regions: [
@46-51,
@48-53,
],
space_before: [
Slice(start = 0, length = 0),
@ -17,16 +17,16 @@ SpaceBefore(
type_defs: [],
value_defs: [
Body(
@46-47 Identifier(
@48-49 Identifier(
"x",
),
@50-51 Num(
@52-53 Num(
"5",
),
),
],
},
@53-55 SpaceBefore(
@55-57 SpaceBefore(
Num(
"42",
),
@ -43,8 +43,11 @@ SpaceBefore(
LineComment(
"## not docs!",
),
LineComment(
"#still not docs",
DocComment(
"actually docs",
),
DocComment(
"",
),
LineComment(
"#####",

View file

@ -1,6 +1,7 @@
#######
### not docs!
##still not docs
##actually docs
##
######
x = 5

View file

@ -377,7 +377,7 @@ mod test_snapshots {
pass/nonempty_hosted_header.header,
pass/nonempty_package_header.header,
pass/nonempty_platform_header.header,
pass/not_docs.expr,
pass/docs.expr,
pass/not_multiline_string.expr,
pass/number_literal_suffixes.expr,
pass/one_backpassing.expr,