Changeset 16262 in josm for trunk/test/unit/org
- Timestamp:
- 2020-04-11T18:00:31+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/tools/OverpassTurboQueryWizardTest.java
r16261 r16262 39 39 public void testKeyValue() { 40 40 assertQueryEquals(" nwr[\"amenity\"=\"drinking_water\"];\n", "amenity=drinking_water"); 41 assertQueryEquals(" nwr[\"amenity\"];\n", "amenity=*"); 41 42 } 42 43 … … 46 47 @Test 47 48 public void testKeyNotValue() { 48 assertQueryEquals(" nwr[\"amenity\"!=\"drinking_water\"];\n", " amenity!=drinking_water");49 assertQueryEquals(" nwr[ \"amenity\"!=\"drinking_water\"];\n", "amenity<>drinking_water");49 assertQueryEquals(" nwr[\"amenity\"!=\"drinking_water\"];\n", "-amenity=drinking_water"); 50 assertQueryEquals(" nwr[!\"amenity\"];\n", "-amenity=*"); 50 51 } 51 52 … … 57 58 assertQueryEquals(" nwr[\"foo\"~\"bar\"];\n", "foo~bar"); 58 59 assertQueryEquals(" nwr[\"foo\"~\"bar\"];\n", "foo~/bar/"); 59 assertQueryEquals(" nwr[\"foo\"~\"bar\"];\n", "foo~=bar");60 assertQueryEquals(" nwr[\"foo\"~\"bar\"];\n", "foo~=/bar/");61 assertQueryEquals(" nwr[\"foo\"~\"bar\"];\n", "foo like bar");62 assertQueryEquals(" nwr[\"foo\"~\"bar\"];\n", "foo like /bar/");63 60 // case insensitive 64 61 assertQueryEquals(" nwr[\"foo\"~\"bar\",i];\n", "foo~/bar/i"); 65 62 // negated 66 assertQueryEquals(" nwr[\"foo\"!~\"bar\"];\n", "foo!~bar"); 67 assertQueryEquals(" nwr[\"foo\"!~\"bar\"];\n", "foo not like bar"); 63 assertQueryEquals(" nwr[\"foo\"!~\"bar\"];\n", "-foo~bar"); 64 assertQueryEquals(" nwr[\"foo\"!~\"bar\",i];\n", "-foo~/bar/i"); 65 } 66 67 /** 68 * Test OSM boolean true/false. 69 */ 70 @Test 71 public void testOsmBoolean() { 72 assertQueryEquals(" nwr[\"highway\"][\"oneway\"~\"true|yes|1|on\"];\n", "highway=* AND oneway?"); 73 assertQueryEquals(" nwr[\"highway\"][\"oneway\"~\"false|no|0|off\"];\n", "highway=* AND -oneway?"); 68 74 } 69 75 … … 84 90 public void testBooleanOr() { 85 91 assertQueryEquals(" nwr[\"foo\"=\"bar\"];\n nwr[\"baz\"=\"42\"];\n", "foo=bar or baz=42"); 86 assertQueryEquals(" nwr[\"foo\"=\"bar\"];\n nwr[\"baz\"=\"42\"];\n", "foo=bar || baz=42");87 92 assertQueryEquals(" nwr[\"foo\"=\"bar\"];\n nwr[\"baz\"=\"42\"];\n", "foo=bar | baz=42"); 88 93 } … … 118 123 @Test 119 124 public void testUser() { 120 assertQueryEquals(" nwr(user:\"foo\");\n nwr(uid:42);\n", "user:foo or u id:42");125 assertQueryEquals(" nwr(user:\"foo\");\n nwr(uid:42);\n", "user:foo or user:42"); 121 126 } 122 127 … … 126 131 @Test 127 132 public void testEmpty() { 128 assertQueryEquals(" way[\"foo\"~\"^$\"];\n", "foo= ''and type:way");133 assertQueryEquals(" way[\"foo\"~\"^$\"];\n", "foo=\"\" and type:way"); 129 134 } 130 135 … … 220 225 @Test(expected = UncheckedParseException.class) 221 226 public void testErroneous() { 222 OverpassTurboQueryWizard.getInstance().constructQuery(" foo");227 OverpassTurboQueryWizard.getInstance().constructQuery("-(foo or bar)"); 223 228 } 224 229 }
Note:
See TracChangeset
for help on using the changeset viewer.