From ddf614b732649875f20b54af3ef622c5c39127ff Mon Sep 17 00:00:00 2001 From: JJ Date: Wed, 28 Dec 2022 18:01:08 -0800 Subject: Clean up tests some and remove console interface --- src/test/model/css/CssParserTest.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/test/model/css') diff --git a/src/test/model/css/CssParserTest.java b/src/test/model/css/CssParserTest.java index 42cdd9f..e6ea519 100644 --- a/src/test/model/css/CssParserTest.java +++ b/src/test/model/css/CssParserTest.java @@ -1,6 +1,5 @@ package model.css; -import model.css.CssParser; import org.javatuples.Pair; import org.junit.jupiter.api.Test; @@ -10,15 +9,15 @@ import static org.junit.jupiter.api.Assertions.assertEquals; public class CssParserTest { + String idiomaticCss = "body { background-color: '#\\'f0f0f2'; margin: 0; padding: 0; font-family: -apple-system, system-ui, BlinkMacSystemFont, \"Segoe\\\" UI\", 'Open\\' Sans', \"Helvetica Neue\", Helvetica, Arial, sans-serif;}div { width: 600px; margin: 5em auto; padding: 2em; background-color: #fdfdff; border-radius: 0.5em; box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);}a:link, a:visited { color: #38488f; text-decoration: none;}@media (max - width : 700px) { @media () {div { margin: 0 auto; width: auto }}}"; + @Test void testIdiomaticCss() { - String idiomaticCss = "body { background-color: '#\\'f0f0f2'; margin: 0; padding: 0; font-family: -apple-system, system-ui, BlinkMacSystemFont, \"Segoe\\\" UI\", 'Open\\' Sans', \"Helvetica Neue\", Helvetica, Arial, sans-serif;}div { width: 600px; margin: 5em auto; padding: 2em; background-color: #fdfdff; border-radius: 0.5em; box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);}a:link, a:visited { color: #38488f; text-decoration: none;}@media (max - width : 700px) { @media () {div { margin: 0 auto; width: auto }}}"; - - ArrayList>>> expected = new ArrayList<>(); - ArrayList> body = new ArrayList<>(); - ArrayList> divOne = new ArrayList<>(); - ArrayList> selectors = new ArrayList<>(); - ArrayList> divTwo = new ArrayList<>(); + var expected = new ArrayList>>>(); + var body = new ArrayList>(); + var divOne = new ArrayList>(); + var selectors = new ArrayList>(); + var divTwo = new ArrayList>(); expected.add(new Pair<>("body", body)); expected.add(new Pair<>("div", divOne)); expected.add(new Pair<>("a:link,a:visited", selectors)); @@ -40,7 +39,6 @@ public class CssParserTest { CssParser parser = new CssParser(); assertEqualsCss(parser.parseCSS(idiomaticCss), expected); - // System.out.println(parser.parseCSS(idiomaticCss)); } @Test -- cgit v1.2.3-70-g09d2