Skip to content

Commit

Permalink
Add test case for pest-parser/site#58
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Apr 5, 2024
1 parent c47a49a commit 331c7ea
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,4 +438,24 @@ mod tests {
"#,
}
}

#[test]
fn test_tailing_comments() {
expect_correction! {
r#"
number = {
"-"? ~ // sign
("0" | '1'..'9' ~ ASCII_DIGIT*) ~ ("." ~ ASCII_DIGIT*)? ~ // fraction
"E"|"e" ~ ("+" | "-")? ~ASCII_DIGIT* // exponent
}
"#,
r#"
number = {
"-"? ~ // sign
("0" | '1'..'9' ~ ASCII_DIGIT*) ~ ("." ~ ASCII_DIGIT*)? ~ // fraction
"E"|"e" ~ ("+" | "-")? ~ASCII_DIGIT* // exponent
}
"#,
}
}
}

0 comments on commit 331c7ea

Please sign in to comment.