fix: bad parsing of comments at end of file closes #551

This commit is contained in:
rvcas
2023-05-30 11:07:39 -04:00
parent c3b8ff0009
commit 26a607eb00
3 changed files with 23 additions and 2 deletions

View File

@@ -38,6 +38,26 @@ fn windows_newline() {
)
}
#[test]
fn can_handle_comments_at_end_of_file() {
let code = indoc! {r#"
use aiken
// some comment
// more comments"#};
assert_definitions(
code,
vec![ast::UntypedDefinition::Use(Use {
location: Span::new((), 0..9),
module: vec!["aiken".to_string()],
as_name: None,
unqualified: vec![],
package: (),
})],
)
}
#[test]
fn type_annotation_with_module_prefix() {
let code = indoc! {r#"