Skip to content

Commit

Permalink
unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
b3b00 committed Jul 2, 2024
1 parent d1c490d commit b5aac18
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions tests/ParserTests/lexer/GenericLexerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public enum HexaTokenDefault

public enum HexaTokenConflictId
{
EOS= 0,


[Hexa("hexa")]HEXA,

[AlphaId] ID
Expand Down Expand Up @@ -1227,14 +1230,12 @@ public void TestHexaConflictId()
Check.That(lexerResult).IsOkLexing();
Check.That(lexerResult.Tokens).IsNotNull();
Check.That(lexerResult.Tokens).CountIs(5);
Check.That(lexerResult.Tokens.Extracting(x => (x.TokenID,x.HexaIntValue)).Take(3)).IsEqualTo(new List<(HexaTokenConflictId,long)>()
{
(HexaTokenConflictId.HEXA,Convert.ToInt32("AA",16)),
(HexaTokenConflictId.HEXA,Convert.ToInt32("123",16)),
(HexaTokenConflictId.HEXA,Convert.ToInt32("AB89CF",16))
});
Check.That(lexerResult.Tokens[3].TokenID).IsEqualTo(HexaTokenConflictId.ID);
Check.That(lexerResult.Tokens[3].Value).IsEqualTo("hello");



Check.That(lexerResult.Tokens.Extracting(x => (x.TokenID)).Take(4)).IsEqualTo(new List<HexaTokenConflictId>()
{ HexaTokenConflictId.ID, HexaTokenConflictId.HEXA, HexaTokenConflictId.HEXA, HexaTokenConflictId.ID });

}

[Fact]
Expand Down

0 comments on commit b5aac18

Please sign in to comment.