상속: TemplateLoader
예제 #1
0
 private void run(String testName, bool pretty, JadeModel model)
 {
     JadeParser parser = null;
     try
     {
         FileTemplateLoader loader = new FileTemplateLoader(TestFileHelper.getCompilerErrorsResourcePath(""),
             "UTF-8");
         parser = new JadeParser(testName, loader);
     }
     catch (IOException e)
     {
         Trace.WriteLine(e);
     }
     Node root = parser.parse();
     Jade.Compiler.Compiler compiler = new Jade.Compiler.Compiler(root);
     compiler.setPrettyPrint(pretty);
     String expected = readFile(testName + ".html");
     model.addFilter("markdown", new MarkdownFilter());
     model.addFilter("plain", new PlainFilter());
     String html;
     try
     {
         html = compiler.compileToString(model);
         Assert.AreEqual(expected.Trim(), html.Trim(), testName);
         Assert.Fail();
     }
     catch (JadeCompilerException e)
     {
         Trace.WriteLine(e);
     }
 }
예제 #2
0
        //throws Exception
        public JadeLexerTest()
        {
            FileTemplateLoader loader1 = new FileTemplateLoader(TestFileHelper.getLexerResourcePath(""), "UTF-8");
            lexer1 = new JadeLexer("test_file1.jade", loader1);

            FileTemplateLoader loader2 = new FileTemplateLoader(TestFileHelper.getLexerResourcePath(""), "UTF-8");
            lexer2 = new JadeLexer("empty_file.jade", loader2);
        }
예제 #3
0
파일: TokenTest.cs 프로젝트: rnrn/Jade4Net
 protected JadeLexer initLexer(String fileName)
 {
     FileTemplateLoader loader;
     try
     {
         loader = new FileTemplateLoader(TestFileHelper.getLexerResourcePath(""), "UTF-8");
         return new JadeLexer(fileName, loader);
     }
     catch (Exception e)
     {
         Trace.WriteLine(e);
         return null;
     }
 }
예제 #4
0
파일: ParserTest.cs 프로젝트: rnrn/Jade4Net
 protected void loadInParser(String fileName)
 {
     try
     {
         FileTemplateLoader loader = new FileTemplateLoader(
                 TestFileHelper.getParserResourcePath(""), "UTF-8");
         parser = new JadeParser(fileName, loader);
     }
     catch (IOException e)
     {
         Trace.WriteLine(e);
         Assert.Fail("template " + fileName + " was not found");
     }
     root = parser.parse();
 }