diff options
author | Marc Englund <marc@vaadin.com> | 2012-09-06 09:41:08 +0300 |
---|---|---|
committer | Marc Englund <marc@vaadin.com> | 2012-09-06 09:41:22 +0300 |
commit | 4710cbf7d6a73490ff292319af82b4746e509e4b (patch) | |
tree | 4f5403eea093032941c25abaed194a07973b61ee /sass/tests | |
parent | 28a504e64a9701ccae9177cf815e27a13b1b1ca1 (diff) | |
download | vaadin-framework-4710cbf7d6a73490ff292319af82b4746e509e4b.tar.gz vaadin-framework-4710cbf7d6a73490ff292319af82b4746e509e4b.zip |
Applied patch from #9471 (+ generated with JavaCC)
Diffstat (limited to 'sass/tests')
-rw-r--r-- | sass/tests/resources/basic/properties.css | 2 | ||||
-rw-r--r-- | sass/tests/resources/css/control-directives.css | 24 | ||||
-rw-r--r-- | sass/tests/resources/css/functions.css | 2 | ||||
-rw-r--r-- | sass/tests/resources/css/nesting.css | 2 | ||||
-rw-r--r-- | sass/tests/resources/css/semicolons.css | 2 | ||||
-rw-r--r-- | sass/tests/resources/scss/control-directives.scss | 19 | ||||
-rw-r--r-- | sass/tests/src/com/vaadin/sass/testcases/scss/ControlDirectives.java | 11 |
7 files changed, 46 insertions, 16 deletions
diff --git a/sass/tests/resources/basic/properties.css b/sass/tests/resources/basic/properties.css index 946ee3a675..13d096292c 100644 --- a/sass/tests/resources/basic/properties.css +++ b/sass/tests/resources/basic/properties.css @@ -64,4 +64,4 @@ min-height: 20cm; overflow: visible; } -} +}
\ No newline at end of file diff --git a/sass/tests/resources/css/control-directives.css b/sass/tests/resources/css/control-directives.css index 0a6f1f7233..dbc44e886c 100644 --- a/sass/tests/resources/css/control-directives.css +++ b/sass/tests/resources/css/control-directives.css @@ -1 +1,23 @@ -Implement a sane test case.
\ No newline at end of file +.salamander-icon #animal, .menu { + background-image: url(/images/salamander.png); + font-size: 10px; + font-color: blue; +} + +.egret-icon #animal, .menu { + background-image: url(/images/egret.png); + font-size: 10px; + font-color: blue; +} + +.sea-slug-icon #animal, .menu { + background-image: url(/images/sea-slug.png); + font-size: 10px; + font-color: blue; +} + +.puma-icon #animal, .menu { + background-image: url(/images/puma.png); + font-size: 10px; + font-color: blue; +}
\ No newline at end of file diff --git a/sass/tests/resources/css/functions.css b/sass/tests/resources/css/functions.css index de87462b46..0fef5d899f 100644 --- a/sass/tests/resources/css/functions.css +++ b/sass/tests/resources/css/functions.css @@ -11,4 +11,4 @@ color: #200; color: #f00000; color: #f00; -} +}
\ No newline at end of file diff --git a/sass/tests/resources/css/nesting.css b/sass/tests/resources/css/nesting.css index 2400c73d43..b3861a0131 100644 --- a/sass/tests/resources/css/nesting.css +++ b/sass/tests/resources/css/nesting.css @@ -44,4 +44,4 @@ .main .second.third .fourth { color: black; -} +}
\ No newline at end of file diff --git a/sass/tests/resources/css/semicolons.css b/sass/tests/resources/css/semicolons.css index 8a08617638..ba28e8cab4 100644 --- a/sass/tests/resources/css/semicolons.css +++ b/sass/tests/resources/css/semicolons.css @@ -7,4 +7,4 @@ .missing-semicolon-on-last-row { color: red; background-color: blue; -} +}
\ No newline at end of file diff --git a/sass/tests/resources/scss/control-directives.scss b/sass/tests/resources/scss/control-directives.scss index febd563f19..3da1d337cc 100644 --- a/sass/tests/resources/scss/control-directives.scss +++ b/sass/tests/resources/scss/control-directives.scss @@ -1,14 +1,13 @@ -@for $i from 1 through 3 { - .item-#{$i} { width: 2em * $i; } -} - -@while $i > 0 { - .item-#{$i} { width: 2em * $i; } - $i: $i - 2; -} - @each $animal in puma, sea-slug, egret, salamander { - .#{$animal}-icon { + .#{$animal}-icon #animal, .menu { background-image: url('/images/#{$animal}.png'); + @include logo(10px); } +} + +@mixin logo($size){ + font: { + size: $size; + color: blue; + } }
\ No newline at end of file diff --git a/sass/tests/src/com/vaadin/sass/testcases/scss/ControlDirectives.java b/sass/tests/src/com/vaadin/sass/testcases/scss/ControlDirectives.java index 033bbb0a1f..b829c0c665 100644 --- a/sass/tests/src/com/vaadin/sass/testcases/scss/ControlDirectives.java +++ b/sass/tests/src/com/vaadin/sass/testcases/scss/ControlDirectives.java @@ -28,6 +28,8 @@ import com.vaadin.sass.ScssStylesheet; import com.vaadin.sass.handler.SCSSDocumentHandler; import com.vaadin.sass.handler.SCSSDocumentHandlerImpl; import com.vaadin.sass.parser.Parser; +import com.vaadin.sass.tree.MixinDefNode; +import com.vaadin.sass.tree.controldirective.EachDefNode; public class ControlDirectives extends AbstractTestBase { @@ -42,7 +44,14 @@ public class ControlDirectives extends AbstractTestBase { parser.parseStyleSheet(getClass().getResource(scss).getPath()); ScssStylesheet root = handler.getStyleSheet(); Assert.assertNotNull(root); - Assert.fail("Implement assert nodes"); + + Assert.assertEquals(2, root.getChildren().size()); + + Assert.assertTrue(root.getChildren().get(0) instanceof EachDefNode); + Assert.assertEquals(1, root.getChildren().get(0).getChildren().size()); + + Assert.assertTrue(root.getChildren().get(1) instanceof MixinDefNode); + } @Test |