diff --git a/ph-css/src/test/java/com/helger/css/parser/ParserCSS30Test.java b/ph-css/src/test/java/com/helger/css/parser/ParserCSS30Test.java index e54879c9..1ab4c6a1 100644 --- a/ph-css/src/test/java/com/helger/css/parser/ParserCSS30Test.java +++ b/ph-css/src/test/java/com/helger/css/parser/ParserCSS30Test.java @@ -16,6 +16,7 @@ */ package com.helger.css.parser; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -61,7 +62,31 @@ public void testBasic2 () throws ParseException aNode); assertNotNull (aCSS); + // Remove all font-face rules for (final ICSSTopLevelRule aTopLevelRule : aCSS.getAllFontFaceRules ()) assertTrue (aCSS.removeRule (aTopLevelRule).isChanged ()); } + + @Test + public void testBasic3 () throws ParseException + { + final ParserCSS30TokenManager aTokenHdl = new ParserCSS30TokenManager (new CSSCharStream (new NonBlockingStringReader ("@import url(\"anything\"); bla foo;"))); + aTokenHdl.setCustomErrorHandler (CSSReader.getDefaultParseErrorHandler ()); + + final ParserCSS30 aParser = new ParserCSS30 (aTokenHdl); + aParser.disable_tracing (); + aParser.setBrowserCompliantMode (true); + aParser.setCustomErrorHandler (CSSReader.getDefaultParseErrorHandler ()); + final CSSNode aNode = aParser.styleSheet (); + assertNotNull (aNode); + + final CascadingStyleSheet aCSS = CSSHandler.readCascadingStyleSheetFromNode (ECSSVersion.CSS30, + CSSReader.getDefaultInterpretErrorHandler (), + false, + aNode); + assertNotNull (aCSS); + + assertEquals (1, aCSS.getAllImportRules ().size ()); + assertEquals (0, aCSS.getAllRules ().size ()); + } }