-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(stricter_postcodes): enforce stricter postcode parsing * feat(stricter_postcodes): allow postcode in start position if it is the only token in its section
- Loading branch information
1 parent
34ddc92
commit e77bebb
Showing
3 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const AddressParser = require('../parser/AddressParser') | ||
|
||
const testcase = (test, common) => { | ||
let parser = new AddressParser() | ||
let assert = common.assert.bind(null, test, parser) | ||
|
||
assert('6000, NSW, Australia', [ | ||
{ postcode: '6000' }, | ||
{ region: 'NSW' }, { country: 'Australia' } | ||
], true) | ||
} | ||
|
||
module.exports.all = (tape, common) => { | ||
function test (name, testFunction) { | ||
return tape(`address AUS: ${name}`, testFunction) | ||
} | ||
|
||
testcase(test, common) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters