|
4 | 4 | #include <osmium/memory/buffer.hpp> |
5 | 5 | #include <osmium/osm/tag.hpp> |
6 | 6 | #include <osmium/tags/filter.hpp> |
7 | | -#include <osmium/tags/regex_filter.hpp> |
8 | 7 | #include <osmium/tags/taglist.hpp> |
9 | 8 |
|
10 | 9 | #include <algorithm> |
@@ -190,68 +189,3 @@ TEST_CASE("KeyValueFilter") { |
190 | 189 | } |
191 | 190 |
|
192 | 191 | } |
193 | | - |
194 | | -TEST_CASE("RegexFilter matches some tags") { |
195 | | - osmium::memory::Buffer buffer{10240}; |
196 | | - |
197 | | - osmium::tags::RegexFilter filter{false}; |
198 | | - filter.add(true, "highway", std::regex{".*_link"}); |
199 | | - |
200 | | - const osmium::TagList& tag_list1 = make_tag_list(buffer, { |
201 | | - { "highway", "primary_link" }, |
202 | | - { "source", "GPS" } |
203 | | - }); |
204 | | - const osmium::TagList& tag_list2 = make_tag_list(buffer, { |
205 | | - { "highway", "primary" }, |
206 | | - { "source", "GPS" } |
207 | | - }); |
208 | | - |
209 | | - check_filter(tag_list1, filter, {true, false}); |
210 | | - check_filter(tag_list2, filter, {false, false}); |
211 | | -} |
212 | | - |
213 | | -TEST_CASE("RegexFilter matches some tags with lvalue regex") { |
214 | | - osmium::memory::Buffer buffer{10240}; |
215 | | - osmium::tags::RegexFilter filter{false}; |
216 | | - const std::regex r{".*straße"}; |
217 | | - filter.add(true, "name", r); |
218 | | - |
219 | | - const osmium::TagList& tag_list = make_tag_list(buffer, { |
220 | | - { "highway", "primary" }, |
221 | | - { "name", "Hauptstraße" } |
222 | | - }); |
223 | | - |
224 | | - check_filter(tag_list, filter, {false, true}); |
225 | | -} |
226 | | - |
227 | | -TEST_CASE("KeyPrefixFilter matches some keys") { |
228 | | - osmium::memory::Buffer buffer{10240}; |
229 | | - |
230 | | - osmium::tags::KeyPrefixFilter filter{false}; |
231 | | - filter.add(true, "name:"); |
232 | | - |
233 | | - const osmium::TagList& tag_list = make_tag_list(buffer, { |
234 | | - { "highway", "primary" }, |
235 | | - { "name:de", "Hauptstraße" } |
236 | | - }); |
237 | | - |
238 | | - check_filter(tag_list, filter, {false, true}); |
239 | | - |
240 | | -} |
241 | | - |
242 | | -TEST_CASE("Generic Filter with regex matches some keys") { |
243 | | - osmium::memory::Buffer buffer{10240}; |
244 | | - |
245 | | - osmium::tags::Filter<std::regex> filter{false}; |
246 | | - filter.add(true, std::regex{"restriction.+conditional"}); |
247 | | - |
248 | | - const osmium::TagList& tag_list = make_tag_list(buffer, { |
249 | | - { "highway", "primary" }, |
250 | | - { "restrictionconditional", "only_right_turn @ (Mo-Fr 07:00-14:00)" }, |
251 | | - { "restriction:conditional", "only_right_turn @ (Mo-Fr 07:00-14:00)" }, |
252 | | - { "restriction:psv:conditional", "only_right_turn @ (Mo-Fr 07:00-14:00)" } |
253 | | - }); |
254 | | - |
255 | | - check_filter(tag_list, filter, {false, false, true, true}); |
256 | | - |
257 | | -} |
0 commit comments