Last change
on this file since 9666 was 9666, checked in by stoecker, 8 years ago |
see #12410 fix style of tests
|
-
Property svn:eol-style
set to
native
|
File size:
1.4 KB
|
Rev | Line | |
---|
[4069] | 1 | // License: GPL. For details, see LICENSE file.
|
---|
| 2 | package org.openstreetmap.josm.gui.mappaint.mapcss;
|
---|
| 3 |
|
---|
| 4 | import static org.junit.Assert.*
|
---|
| 5 |
|
---|
| 6 | import org.junit.*
|
---|
[7068] | 7 | import org.openstreetmap.josm.JOSMFixture;
|
---|
[4069] | 8 |
|
---|
| 9 |
|
---|
| 10 | class ParsingLinkSelectorTest {
|
---|
| 11 |
|
---|
| 12 | @BeforeClass
|
---|
| 13 | public static void createJOSMFixture(){
|
---|
| 14 | JOSMFixture.createUnitTestFixture().init()
|
---|
| 15 | }
|
---|
[9666] | 16 |
|
---|
[4069] | 17 | @Test
|
---|
| 18 | public void parseEmptyChildSelector() {
|
---|
| 19 | def css = """
|
---|
| 20 | relation > way {}
|
---|
| 21 | """
|
---|
| 22 | MapCSSStyleSource source = new MapCSSStyleSource(css)
|
---|
[9666] | 23 | source.loadStyleSource()
|
---|
[4069] | 24 | assert source.rules.size() == 1
|
---|
| 25 | }
|
---|
[9666] | 26 |
|
---|
[4069] | 27 | @Test
|
---|
| 28 | public void parseEmptyParentSelector() {
|
---|
| 29 | def css = """
|
---|
| 30 | way < relation {}
|
---|
| 31 | """
|
---|
| 32 | MapCSSStyleSource source = new MapCSSStyleSource(css)
|
---|
| 33 | source.loadStyleSource()
|
---|
| 34 | assert source.rules.size() == 1
|
---|
| 35 | }
|
---|
[9666] | 36 |
|
---|
| 37 |
|
---|
[4069] | 38 | @Test
|
---|
| 39 | public void parseChildSelectorWithKeyValueCondition() {
|
---|
| 40 | def css = """
|
---|
| 41 | relation >[role="my_role"] way {}
|
---|
| 42 | """
|
---|
| 43 | MapCSSStyleSource source = new MapCSSStyleSource(css)
|
---|
| 44 | source.loadStyleSource()
|
---|
| 45 | assert source.rules.size() == 1
|
---|
| 46 | }
|
---|
[9666] | 47 |
|
---|
[4069] | 48 | @Test
|
---|
| 49 | public void parseChildSelectorWithKeyCondition() {
|
---|
| 50 | def css = """
|
---|
| 51 | relation >["my_role"] way{}
|
---|
| 52 | """
|
---|
| 53 | MapCSSStyleSource source = new MapCSSStyleSource(css)
|
---|
| 54 | source.loadStyleSource()
|
---|
| 55 | assert source.rules.size() == 1
|
---|
| 56 | }
|
---|
| 57 | }
|
---|
[4074] | 58 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.