Skip to content

Commit 27719f7

Browse files
committed
#189 - unti test
1 parent 80f7a6b commit 27719f7

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

tests/HydraScript.UnitTests/Domain/FrontEnd/RegexLexerTests.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,22 @@ public void EmptyTextTest() =>
3636
Assert.NotEmpty(_regexLexer.GetTokens(""));
3737

3838
[Fact]
39-
public void GetTokensSkipIgnorableTypesTest()
39+
public void GetTokens_IgnorableTypes_Skipped()
4040
{
4141
const string text = "let x = 1 // int";
4242
var tokens = _regexLexer.GetTokens(text);
43-
Assert.DoesNotContain(_regexLexer.Structure.FindByTag("Comment"), tokens.Select(x => x.Type));
43+
Assert.DoesNotContain(_regexLexer.Structure.FindByTag("DoubleSlashComment"), tokens.Select(x => x.Type));
44+
}
45+
46+
[Fact]
47+
public void GetTokens_Comments_EmptyList()
48+
{
49+
const string text = """
50+
// double slash comment
51+
# shebang comment
52+
""";
53+
var tokens = _regexLexer.GetTokens(text);
54+
Assert.Empty(tokens.Except([new EndToken()]));
4455
}
4556

4657
[Theory, ClassData(typeof(LexerKeywordInsideIdentData))]

0 commit comments

Comments
 (0)