You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

VariableGuarded.java 1.2KB

123456789101112131415161718192021222324252627282930313233343536
  1. package com.vaadin.sass.testcases.scss;
  2. import java.io.IOException;
  3. import junit.framework.Assert;
  4. import org.junit.Test;
  5. import org.w3c.css.sac.CSSException;
  6. import com.vaadin.sass.AbstractTestBase;
  7. import com.vaadin.sass.internal.ScssStylesheet;
  8. import com.vaadin.sass.internal.handler.SCSSDocumentHandler;
  9. import com.vaadin.sass.internal.handler.SCSSDocumentHandlerImpl;
  10. import com.vaadin.sass.internal.parser.Parser;
  11. public class VariableGuarded extends AbstractTestBase {
  12. String scss = "/scss/var-guarded.scss";
  13. String css = "/css/var-guarded.css";
  14. @Test
  15. public void testParser() throws CSSException, IOException {
  16. Parser parser = new Parser();
  17. SCSSDocumentHandler handler = new SCSSDocumentHandlerImpl();
  18. parser.setDocumentHandler(handler);
  19. parser.parseStyleSheet(getClass().getResource(scss).getPath());
  20. ScssStylesheet root = handler.getStyleSheet();
  21. Assert.assertEquals(4, root.getChildren().size());
  22. }
  23. @Test
  24. public void testCompiler() throws Exception {
  25. testCompiler(scss, css);
  26. Assert.assertEquals("Original CSS and parsed CSS doesn't match",
  27. comparisonCss, parsedScss);
  28. }
  29. }