Skip to content

Commit

Permalink
test: add additional test for lexing block comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kthompson committed May 31, 2024
1 parent 1a8b16f commit d6ecb42
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/Panther.Tests/CodeAnalysis/Syntax/LexerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,37 @@ public void CanLexComment(LineCommentTriviaData lineCommentTrivia)
}
);
}

[Property]
public void CanLexBlockComment()
{
var text = AnnotatedText
.Parse(
$@"
/*
1
*/
6"
)
.Text;
var tokens = SyntaxTree.ParseTokens(text);

Assert.Collection(
tokens,
token1 =>
{
Assert.NotNull(token1);
Assert.Collection(
token1.LeadingTrivia,
trivia =>
{
Assert.Equal(SyntaxKind.BlockCommentTrivia, trivia.Kind);
},
trivia => { }
);
Assert.Equal(SyntaxKind.NumberToken, token1.Kind);
Assert.Equal("6", token1.Text);
}
);
}
}

0 comments on commit d6ecb42

Please sign in to comment.