aboutsummaryrefslogtreecommitdiff
path: root/test/withinRange.js
diff options
context:
space:
mode:
authorAndrew Harvey <andrew@alantgeo.com.au>2021-06-30 15:36:04 +1000
committerAndrew Harvey <andrew@alantgeo.com.au>2021-06-30 15:36:04 +1000
commit2a34ec683ee630d5667abd1c6bd7767346c0afa8 (patch)
tree968024f47f8b5457155de329353e4c91af8bdbaa /test/withinRange.js
parentccc21c674a41913d30a2ff2c5d09aefc378e342e (diff)
fix within range test
Diffstat (limited to 'test/withinRange.js')
-rw-r--r--test/withinRange.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/withinRange.js b/test/withinRange.js
index 1158c20..5dd349c 100644
--- a/test/withinRange.js
+++ b/test/withinRange.js
@@ -70,6 +70,29 @@ const AC_2 = {
}
}
+const subNumber = {
+ "type": "Feature",
+ "properties": {
+ "addr:housenumber": "12C",
+ "addr:street": "Main Street"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [0, 0]
+ }
+}
+const rangeOutsideSub = {
+ "type": "Feature",
+ "properties": {
+ "addr:housenumber": "118-120",
+ "addr:street": "Main Street"
+ },
+ "geometry": {
+ "type": "Point",
+ "coordinates": [0, 0]
+ }
+}
+
test('withinRange', t => {
t.same(
@@ -102,6 +125,11 @@ test('withinRange', t => {
false,
'A Main Street not within AC Secondary Street'
)
+ t.same(
+ withinRange(subNumber, rangeOutsideSub),
+ false,
+ '12C not within 118-120'
+ )
t.end()
})