public void MultiLineErrorPositionTest() { var lexer = Lexer.CreateState("/*/"); _ = CommentScanner.ScanMultiLine(lexer, ref this.token); Assert.Equal(3, lexer.Src.Index); }
public void ScanMultiLineTrueTest() { var lexer = Lexer.CreateState("/**/"); bool result = CommentScanner.ScanMultiLine(lexer, ref this.token); Assert.True(result); }
public void MultiLineNewLinePositionTest() { var lexer = Lexer.CreateState("/*" + Environment.NewLine + "*/"); _ = CommentScanner.ScanMultiLine(lexer, ref this.token); Assert.Equal(5, lexer.Src.Index); }
public void ScanMultiLineFalseTest() { foreach (string text in new[] { "/*/", "/**", "/*" }) { var lexer = Lexer.CreateState(text); bool result = CommentScanner.ScanMultiLine(lexer, ref this.token); Assert.False(result); } }
public void ScanMultiLineNewLineTest() { string comment = "/*" + Environment.NewLine + "*/"; var lexer = Lexer.CreateState(comment); bool result = CommentScanner.ScanMultiLine(lexer, ref this.token); Assert.True(result); Assert.Equal(comment, this.token.Value); }