Example #1
0
        public void CanParseValidElseStatement(string source, string expectedTree)
        {
            var parser = PreprocessorHelper.BuildPreprocessorParser(source);

            var result = parser.elseStatement();

            Assert.Null(result.exception);
            ParseTreeHelper.TreesAreEqual(expectedTree, result.ToStringTree(parser));
        }
Example #2
0
        public void CanParseValidConstantDefinition(string source, string expectedTree)
        {
            var parser = PreprocessorHelper.BuildPreprocessorParser(source);

            var result = parser.constantDeclaration();

            Assert.Null(result.exception);
            ParseTreeHelper.TreesAreEqual(expectedTree, result.ToStringTree(parser));
        }
Example #3
0
        public void CanParseValidEndIfStatement(string source, string expectedTree)
        {
            var parser = PreprocessorHelper.BuildPreprocessorParser(source);

            var result = parser.endIfStatement();

            Assert.NotNull(result.End());
            Assert.NotNull(result.If());
            Assert.Null(result.exception);
        }