Пример #1
0
 public static void TestStatementParserWithError(string compiland, GlobalSymbolList symbols, string expectedError)
 {
     using (TestCompilerContext context = TestCompilerContext.Create(compiland, symbols, CompilationFlags.NoDebug))
     {
         context.ParseStatement();
         Assert.IsTrue(context.ErrorCount > 0, "Expecting compiler error");
         Assert.AreEqual(expectedError, context.FirstError);
     }
 }
Пример #2
0
 public static string TestStatementParser(string compiland, GlobalSymbolList symbols = null)
 {
     using (TestCompilerContext context = TestCompilerContext.Create(compiland, symbols, CompilationFlags.NoDebug))
     {
         context.ParseStatement();
         Assert.AreEqual(0, context.ErrorCount, context.FirstError.ToString());
         return(context.GetCompilerOutput());
     }
 }