Changeset 15318 in josm


Ignore:
Timestamp:
2019-08-24T13:05:11+02:00 (4 weeks ago)
Author:
Don-vip
Message:

fix #17932 - fix error message localization

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/OpeningHourTest.java

    r15277 r15318  
    5454            try (CachedFile cf = new CachedFile("resource://data/validator/opening_hours.js");
    5555                 Reader reader = cf.getContentReader()) {
    56                 ENGINE.eval(
    57                         "var global=this;var window=this;var process={env:{}};" +
    58                         "var console={};console.debug=print;console.log=print;console.warn=print;console.error=print;");
     56                ENGINE.eval("var console={};console.debug=print;console.log=print;console.warn=print;console.error=print;");
    5957                ENGINE.eval(reader);
    6058                ENGINE.eval("var opening_hours = require('opening_hours');");
  • trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java

    r13147 r15318  
    2626import org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem;
    2727import org.openstreetmap.josm.testutils.JOSMTestRules;
     28import org.openstreetmap.josm.tools.Logging;
    2829
    2930import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    234235        }
    235236    }
     237
     238    /**
     239     * Non-regression test for <a href="https://josm.openstreetmap.de/ticket/17932">Bug #17932</a>.
     240     */
     241    @Test
     242    public void testTicket17932() {
     243        Logging.clearLastErrorAndWarnings();
     244        assertTrue(openingHourTest.checkOpeningHourSyntax("opening_hours", "SH off").isEmpty());
     245        List<String> errors = Logging.getLastErrorAndWarnings();
     246        assertFalse(errors.isEmpty());
     247        assertTrue(errors.get(0), errors.get(0).contains("no SH definition"));
     248    }
    236249}
Note: See TracChangeset for help on using the changeset viewer.