Package juzu.plugin.less.impl.lesser

Examples of juzu.plugin.less.impl.lesser.URLLessContext


    this.lesser = lesser;
  }

  @Test
  public void testSimple() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Compilation compilation = (Compilation)lesser.compile(context, "simple.less");
    Assert.assertEquals(".class {\n" +
      "  width: 2;\n" +
      "}\n", compilation.getValue());
View Full Code Here


    Assert.assertEquals(".class{width:2;}\n", compilation.getValue());
  }

  @Test
  public void testFail() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Failure ret = (Failure)lesser.compile(context, "fail.less");
    LinkedList<LessError> errors = ret.getErrors();
    Assert.assertEquals(1, errors.size());
    LessError error = errors.get(0);
    Assert.assertEquals("fail.less", error.src);
View Full Code Here

    Assert.assertEquals("Parse", error.type);
  }

  @Test
  public void testCannotResolveImport() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Failure failure = (Failure)lesser.compile(context, "cannotresolveimport.less");
    LinkedList<LessError> errors = failure.getErrors();
    Assert.assertEquals(1, errors.size());
    LessError error = errors.get(0);
    Assert.assertEquals(1, error.line);
View Full Code Here

    Assert.assertEquals("Parse", error.type);
  }

  @Test
  public void testSeveralErrors() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Failure failure = (Failure)lesser.compile(context, "severalerrors1.less");
    LinkedList<LessError> errors = failure.getErrors();
    Assert.assertEquals(2, errors.size());
  }
View Full Code Here

    Assert.assertEquals(2, errors.size());
  }

  @Test
  public void testBootstrap() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/bootstrap/"));
    long time = -System.currentTimeMillis();
    Compilation compilation = (Compilation)lesser.compile(context, "bootstrap.less");
    time += System.currentTimeMillis();
    Assert.assertNotNull(compilation);
    System.out.println("Bootstrap parsed in " + time + "ms");
View Full Code Here

    System.out.println("Bootstrap parsed in " + time + "ms");
  }

  @Test
  public void testImport() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Compilation compilation = (Compilation)lesser.compile(context, "importer.less");
    Assert.assertEquals("a {\n" +
      "  width: 2px;\n" +
      "}\n", compilation.getValue());
  }
View Full Code Here

      "}\n", compilation.getValue());
  }

  @Test
  public void testUnresolableVariable() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Failure failure = (Failure)lesser.compile(context, "unresolvablevariable.less");
    LinkedList<LessError> errors = failure.getErrors();
    Assert.assertEquals(1, errors.size());
    LessError error = errors.get(0);
    Assert.assertEquals(1, error.line);
View Full Code Here

    Assert.assertEquals("Name", error.type);
  }

  @Test
  public void testExtract() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Failure failure = (Failure)lesser.compile(context, "extract.less");
    Assert.assertEquals(1, failure.getErrors().size());
    LessError error = failure.getErrors().get(0);
    Assert.assertEquals(2, error.line);
    String[] extract = error.extract;
View Full Code Here

    Assert.assertEquals("// comment 2", extract[2]);
  }

  @Test
  public void testImportRelative() throws Exception {
    URLLessContext context = new URLLessContext(LesserTestCase.class.getClassLoader().getResource("lesser/test/"));
    Compilation compilation = (Compilation)lesser.compile(context, "relative.less");
    Assert.assertEquals("a {\n" +
        "  width: 2px;\n" +
        "}\n", compilation.getValue());
  }
View Full Code Here

TOP

Related Classes of juzu.plugin.less.impl.lesser.URLLessContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.