Changeset 8936 in josm for trunk/test
- Timestamp:
- 2015-10-23T23:34:29+02:00 (9 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/validation/tests/MapCSSTagCheckerTest.java
r8857 r8936 28 28 import org.openstreetmap.josm.data.validation.Severity; 29 29 import org.openstreetmap.josm.data.validation.TestError; 30 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.ParseResult; 30 31 import org.openstreetmap.josm.data.validation.tests.MapCSSTagChecker.TagCheck; 31 32 import org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException; … … 46 47 static MapCSSTagChecker buildTagChecker(String css) throws ParseException { 47 48 final MapCSSTagChecker test = new MapCSSTagChecker(); 48 test.checks.putAll("test", TagCheck.readMapCSS(new StringReader(css)) );49 test.checks.putAll("test", TagCheck.readMapCSS(new StringReader(css)).parseChecks); 49 50 return test; 50 51 } … … 52 53 @Test 53 54 public void testNaturalMarsh() throws Exception { 54 final List<MapCSSTagChecker.TagCheck> checks= MapCSSTagChecker.TagCheck.readMapCSS(new StringReader("" +55 ParseResult result = MapCSSTagChecker.TagCheck.readMapCSS(new StringReader("" + 55 56 "*[natural=marsh] {\n" + 56 57 " throwWarning: tr(\"{0}={1} is deprecated\", \"{0.key}\", tag(\"natural\"));\n" + … … 59 60 " fixAdd: \"wetland=marsh\";\n" + 60 61 "}")); 62 final List<MapCSSTagChecker.TagCheck> checks = result.parseChecks; 61 63 assertEquals(1, checks.size()); 64 assertTrue(result.parseErrors.isEmpty()); 62 65 final MapCSSTagChecker.TagCheck check = checks.get(0); 63 66 assertNotNull(check); … … 87 90 "fixChangeKey: \"highway => construction\";\n" + 88 91 "fixAdd: \"highway=construction\";\n" + 89 "}")). get(0);92 "}")).parseChecks.get(0); 90 93 final Command command = check.fixPrimitive(p); 91 94 assertTrue(command instanceof SequenceCommand);
Note:
See TracChangeset
for help on using the changeset viewer.