diff --git a/src/org/openstreetmap/josm/actions/search/SearchCompiler.java b/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
index b16ffb3..f9946d3 100644
|
a
|
b
|
public class SearchCompiler {
|
| 182 | 182 | long maxDate = rangeA2.isEmpty() ? System.currentTimeMillis() : DateUtils.fromString(rangeA2).getTime(); |
| 183 | 183 | return new TimestampRange(minDate, maxDate); |
| 184 | 184 | } else { |
| 185 | | // I18n: Don't translate timestamp keyword |
| 186 | | throw new ParseError(tr("Expecting <i>min</i>/<i>max</i> after ''timestamp''")); |
| | 185 | throw new ParseError("<html>" + tr("Expecting {0} after {1}", "<i>min</i>/<i>max</i>", "<i>timestamp<i>")); |
| 187 | 186 | } |
| 188 | 187 | } |
| | 188 | } else { |
| | 189 | throw new ParseError(tr("<html>" + "Expecting {0} after {1}", "<code>:</code>", "<i>" + keyword + "<i>")); |
| 189 | 190 | } |
| 190 | 191 | } |
| 191 | | return null; |
| | 192 | throw new IllegalStateException("Not expecting keyword " + keyword); |
| 192 | 193 | } |
| 193 | 194 | |
| 194 | 195 | @Override |
diff --git a/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java b/test/unit/org/openstreetmap/josm/actions/search/SearchCompilerTest.java
index 9c9463b..2f5a332 100644
|
a
|
b
|
|
| 1 | 1 | // License: GPL. For details, see LICENSE file. |
| 2 | 2 | package org.openstreetmap.josm.actions.search; |
| 3 | 3 | |
| | 4 | import static org.junit.Assert.assertEquals; |
| 4 | 5 | import static org.junit.Assert.assertFalse; |
| 5 | 6 | import static org.junit.Assert.assertThat; |
| 6 | 7 | import static org.junit.Assert.assertTrue; |
| … |
… |
public class SearchCompilerTest {
|
| 378 | 379 | anonymous.match(anonymous.n1, false); |
| 379 | 380 | anonymous.match(anonymous.n2, true); |
| 380 | 381 | } |
| | 382 | |
| | 383 | @Test |
| | 384 | public void testFooTypeBar() throws Exception { |
| | 385 | try { |
| | 386 | SearchCompiler.compile("foo type bar"); |
| | 387 | throw new RuntimeException(); |
| | 388 | } catch (ParseError parseError) { |
| | 389 | assertEquals("Expecting <code>:</code> after <i>type<i>", parseError.getMessage()); |
| | 390 | } |
| | 391 | } |
| 381 | 392 | } |