mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 14:18:47 +02:00
#10327 Now hashtags get parsed as comment starters if they are prefixed with any whitespace.
This commit is contained in:
@@ -182,6 +182,20 @@ fn lex_comment_with_space_in_front_of_hashtag() {
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lex_comment_with_tab_in_front_of_hashtag() {
|
||||
let file = b"1..10 | each {echo test\t#testing }";
|
||||
|
||||
let output = lex(file, 0, &[], &[], false);
|
||||
|
||||
assert!(output.1.is_some());
|
||||
assert!(matches!(
|
||||
output.1.unwrap(),
|
||||
ParseError::UnexpectedEof(missing_token, span) if missing_token == "}"
|
||||
&& span == Span::new(33, 34)
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lex_is_incomplete() {
|
||||
let file = b"let x = 300 | ;";
|
||||
|
Reference in New Issue
Block a user