datalust / superpower

A C# parser construction toolkit with high-quality error reporting
Apache License 2.0
1.05k stars 98 forks source link

Unit Testing? #121

Closed Shadowblitz16 closed 3 years ago

Shadowblitz16 commented 3 years ago

How do I unit test a parser?

        [Test]
        public void Chr()
        {
            Parsers.Chr.TryParse("'a'")
        }
nblumhardt commented 3 years ago

Hi! You can see some examples in projects like https://github.com/serilog/serilog-expressions/blob/dev/test/Serilog.Expressions.Tests/ExpressionParserTests.cs

Hope this helps, Nick