Changeset 17114 in josm for trunk/test
- Timestamp:
- 2020-10-08T19:48:57+02:00 (4 years ago)
- Location:
- trunk/test/unit/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/data/osm/search/SearchCompilerTest.java
r16618 r17114 432 432 @Test 433 433 public void testTimestamp() throws SearchParseError { 434 final Match search = SearchCompiler.compile("timestamp:2010/2011");435 434 final Node n1 = new Node(); 436 435 n1.setTimestamp(DateUtils.fromString("2010-01-22")); 437 assertTrue(search.match(n1)); 436 assertTrue(SearchCompiler.compile("timestamp:2010/2011").match(n1)); 437 assertTrue(SearchCompiler.compile("timestamp:2010-01/2011").match(n1)); 438 assertTrue(SearchCompiler.compile("timestamp:2010-01-22/2011").match(n1)); 439 assertFalse(SearchCompiler.compile("timestamp:2010-01-23/2011").match(n1)); 440 assertFalse(SearchCompiler.compile("timestamp:2010/2010-01-21").match(n1)); 438 441 n1.setTimestamp(DateUtils.fromString("2016-01-22")); 439 assertFalse( search.match(n1));442 assertFalse(SearchCompiler.compile("timestamp:2010/2011").match(n1)); 440 443 } 441 444 -
trunk/test/unit/org/openstreetmap/josm/tools/date/DateUtilsTest.java
r17104 r17114 96 96 assertEquals(851042397000L, DateUtils.fromString("1996-12-19T16:39:57-08:00").getTime()); 97 97 assertEquals(-1041337172130L, DateUtils.fromString("1937-01-01T12:00:27.87+00:20").getTime()); 98 // (partial) dates 99 assertEquals(482112000000L, DateUtils.fromString("1985-04-12").getTime()); 100 assertEquals(481161600000L, DateUtils.fromString("1985-04").getTime()); 101 assertEquals(473385600000L, DateUtils.fromString("1985").getTime()); 98 102 } 99 103
Note:
See TracChangeset
for help on using the changeset viewer.