h-adr parsing tests

This page was design to test the parsing of h-adr. These tests are part of the micorformats 2 test suite.

Just a name (h-adr parsing test)

665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A.

The expected JSON output:


{
    "items": [{
        "type": ["h-adr"],
        "properties": {
            "name": ["665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A."]
        }
    }]
}

Broken into properties (h-adr parsing test)

665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A.

The expected JSON output:


{
    "items": [{
        "type": ["h-adr"],
        "properties": {
            "street-address": ["665 3rd St."], 
            "extended-address": ["Suite 207"], 
            "locality": ["San Francisco"], 
            "region": ["CA"], 
            "postal-code": ["94107"], 
            "country-name": ["U.S.A."], 
            "name": ["665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A."]
        }
    }]
}

With geo data (h-adr parsing test)

Bricklayer's Arms 3 Charlotte Road, City of London, EC2A 3PE, UK – Geo:(51.526421;-0.081067)

The expected JSON output:


{
    "items": [{
        "type": ["h-adr"],
        "properties": {
            "name": ["Bricklayer's Arms"],
            "label": ["3 Charlotte Road, City of London, EC2A 3PE, UK"],
            "street-address": ["3 Charlotte Road"],
            "locality": ["City of London"],
            "postal-code": ["EC2A 3PE"],
            "country-name": ["UK"],
            "geo": ["51.526421;-0.081067"]
        }
    }]
}

With geo url (h-adr parsing test)

Bricklayer's Arms, London

The expected JSON output:


{
    "items": [{
        "type": ["h-adr"],
        "properties": {
            "name": ["Bricklayer's Arms"],
            "geo": ["geo:51.526421;-0.081067;crs=wgs84;u=40"],
            "locality": ["London"]
        }
    }]
}

Note: The geo format is taken from rfc5870 spec.

Change log:

Contributors :