source: josm/trunk/test/unit/org/openstreetmap/josm/gui/mappaint/mapcss/ParsingLinkSelectorTest.groovy@ 7068

Last change on this file since 7068 was 7068, checked in by Don-vip, 10 years ago

test cleanup

  • Property svn:eol-style set to native
File size: 1.4 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.mappaint.mapcss;
3
4import static org.junit.Assert.*
5
6import org.junit.*
7import org.openstreetmap.josm.JOSMFixture;
8
9
10class ParsingLinkSelectorTest {
11
12 @BeforeClass
13 public static void createJOSMFixture(){
14 JOSMFixture.createUnitTestFixture().init()
15 }
16
17 @Test
18 public void parseEmptyChildSelector() {
19 def css = """
20 relation > way {}
21 """
22 MapCSSStyleSource source = new MapCSSStyleSource(css)
23 source.loadStyleSource()
24 assert source.rules.size() == 1
25 }
26
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 }
36
37
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 }
47
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}
58
Note: See TracBrowser for help on using the repository browser.