Module talk:Tag/testcases

From OpenStreetMap Wiki
Jump to navigation Jump to search

All tests passed.

test_key
Text Expected Actual
☑Y {{#invoke:Tag|key|landuse}} landuse landuse
☑Y {{#invoke:Tag|key|landuse|kl=FR}} landuse landuse
☑Y {{#invoke:Tag|key|landuse|kl=fr}} landuse landuse
☑Y {{#invoke:Tag|key|electrified|subkey=before 1927}} electrified:before 1927 electrified:before 1927
☑Y {{#invoke:Tag|key|cycleway|:=right|::=smoothness|kl=de|kl:=de|kl::=de}} cycleway:right:smoothness cycleway:right:smoothness
☑Y {{#invoke:Tag|key|cycleway|:=right|::=smoothness|lang=de}} cycleway:right:smoothness cycleway:right:smoothness
test_tag
Text Expected Actual
☑Y {{#invoke:Tag|tag|highway}} highway=* highway=*
☑Y {{#invoke:Tag|tag|highway|residential}} highway=residential highway=residential
☑Y {{#invoke:Tag|tag| highway | residential }} highway=residential highway=residential
☑Y {{#invoke:Tag|tag|bridge||yes}} bridge=yes bridge=yes
☑Y {{#invoke:Tag|tag|ref||''ref number''}} ref=ref number ref=ref number
☑Y {{#invoke:Tag|tag|electrified|subkey=before 1927}} electrified:before 1927=* electrified:before 1927=*
☑Y {{#invoke:Tag|tag|network|NL:binnenstedelijke_ring}} network=NL:binnenstedelijke_ring network=NL:binnenstedelijke_ring
☑Y {{#invoke:Tag|tag|network|US:NY:Saint Lawrence}} network=US:NY:Saint Lawrence network=US:NY:Saint Lawrence
☑Y {{#invoke:Tag|tag|name:Zsye|'''🇺🇸'''}} name:Zsye=🇺🇸 name:Zsye=🇺🇸
☑Y {{#invoke:Tag|tag|height|>20}} height=>20 height=>20
test_tag_external_links
Text Expected Actual
☑Y {{#invoke:Tag|tag|wikipedia||fr:Paris}} wikipedia=fr:Paris wikipedia=fr:Paris
☑Y {{#invoke:Tag|tag|wikipedia|subkey=fr||Paris}} wikipedia:fr=Paris wikipedia:fr=Paris
☑Y {{#invoke:Tag|tag|wikipedia|subkey=en||Paris}} wikipedia:en=Paris wikipedia:en=Paris
☑Y {{#invoke:Tag|tag|wikidata||Q90}} wikidata=Q90 wikidata=Q90
☑Y {{#invoke:Tag|tag|operator:wikidata||Q90}} operator:wikidata=Q90 operator:wikidata=Q90
☑Y {{#invoke:Tag|tag|wikimedia_commons||[[c:File:Example.svg|File:Example.svg]]}} wikimedia_commons=File:Example.svg wikimedia_commons=File:Example.svg
☑Y {{#invoke:Tag|tag|website||http://www.paris.fr/}} website=http://www.paris.fr/ website=http://www.paris.fr/
☑Y {{#invoke:Tag|tag|website||[https://www.example.com/ https://www.example.com/]}} website=https://www.example.com/ website=https://www.example.com/
test_tag_languages
Text Expected Actual
☑Y {{#invoke:Tag|tag|kl=de|highway|motorway}} highway=motorway highway=motorway
☑Y {{#invoke:Tag|tag|highway|vl=de|motorway}} highway=motorway highway=motorway
☑Y {{#invoke:Tag|tag|highway|motorway|kl=de|vl=de}} highway=motorway highway=motorway
☑Y {{#invoke:Tag|tag|cycleway|:=right|::=smoothness|excellent|kl=de|kl:=de|kl::=de}} cycleway:right:smoothness=excellent cycleway:right:smoothness=excellent
test_tag_multipart_keys
Text Expected Actual
☑Y {{#invoke:Tag|tag|building:fireproof}} building:fireproof=* building:fireproof=*
☑Y {{#invoke:Tag|tag|addr|subkey=housenumber}} addr:housenumber=* addr:housenumber=*
☑Y {{#invoke:Tag|tag|oneway|:=bicycle}} oneway:bicycle=* oneway:bicycle=*
☑Y {{#invoke:Tag|tag|cycleway|:=right|::=smoothness}} cycleway:right:smoothness=* cycleway:right:smoothness=*
☑Y {{#invoke:Tag|tag|parking|:=right|::=restriction|:::=conditional||charging_only @ (07:00-22:00)}} parking:right:restriction:conditional=charging_only @ (07:00-22:00) parking:right:restriction:conditional=charging_only @ (07:00-22:00)
test_tag_multiple_values
Text Expected Actual
☑Y {{#invoke:Tag|tag|motor_vehicle|agricultural|;=forestry}} motor_vehicle=agricultural;forestry motor_vehicle=agricultural;forestry
☑Y {{#invoke:Tag|tag|access|agricultural|;=forestry|;;=destination}} access=agricultural;forestry;destination access=agricultural;forestry;destination
☑Y {{#invoke:Tag|tag|wheelchair||({{TagValue|wheelchair|yes}}/{{TagValue|wheelchair|no}})}} wheelchair=(yes/no) wheelchair=(yes/no)
☑Y {{#invoke:Tag|tag|motor_vehicle||({{TagValue|motor_vehicle|agricultural}}/{{TagValue|motor_vehicle|forestry}})}} motor_vehicle=(agricultural/forestry) motor_vehicle=(agricultural/forestry)
☑Y {{#invoke:Tag|tag|access||({{TagValue|access|agricultural}}/{{TagValue|access|forestry}}/{{TagValue|access|destination}})}} access=(agricultural/forestry/destination) access=(agricultural/forestry/destination)
test_value
Text Expected Actual
☑Y {{#invoke:Tag|value|highway}} * *
☑Y {{#invoke:Tag|value|highway|motorway}} motorway motorway
☑Y {{#invoke:Tag|value|highway|motorway|''type of the way''}} type of the way type of the way
☑Y {{#invoke:Tag|value|amenity||shelter}} shelter shelter
☑Y {{#invoke:Tag|value|bridge|||yes}} yes yes
☑Y {{#invoke:Tag|value|ref|||''ref number''}} ref number ref number
☑Y {{#invoke:Tag|value|type|boundary}} boundary boundary
test_value_named_parameters
Text Expected Actual
☑Y {{#invoke:Tag|value|link=tag|key=highway|value=motorway}} motorway motorway
☑Y {{#invoke:Tag|value|link=value|key=highway|value=motorway}} motorway motorway
☑Y {{#invoke:Tag|value|link=key|key=highway|value=motorway}} motorway motorway
☑Y {{#invoke:Tag|value|link=key#|key=amenity|value=embassy}} embassy embassy
☑Y {{#invoke:Tag|value|link=none|key=generator:source|value=biomass}} biomass biomass
☑Y {{#invoke:Tag|value|link=none|value=biomass}} biomass biomass
☑Y {{#invoke:Tag|value|lang=ja|link=tag|key=highway|value=motorway}} motorway motorway
☑Y {{#invoke:Tag|value|lang=ja|highway|motorway}} motorway motorway
☑Y {{#invoke:Tag|value|lang=ldn|highway|motorway}} motorway motorway