aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Harvey <andrew@alantgeo.com.au>2021-05-14 16:39:38 +1000
committerAndrew Harvey <andrew@alantgeo.com.au>2021-05-14 16:39:38 +1000
commitbc4c8abf95e865755f25e8d3057cfa4898b1b5c3 (patch)
treed16d040913ea64cbe5b6e11202a62c9f1aafc785 /test
parentf636c81824436a31c47ce164a59e1aeacfd6551d (diff)
fix units to ranges to deal with complex cases
Diffstat (limited to 'test')
-rw-r--r--test/unitsToRanges.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/unitsToRanges.js b/test/unitsToRanges.js
index 7183ad1..0908b1e 100644
--- a/test/unitsToRanges.js
+++ b/test/unitsToRanges.js
@@ -65,7 +65,7 @@ test('units list to addr:flats', t => {
t.same(
unitsToRanges(['1A', '2A', '3']),
- '1A-2A;3',
+ '3;1A-2A',
'partially with suffix'
)
@@ -99,5 +99,11 @@ test('units list to addr:flats', t => {
'source duplicates removed with range'
)
+ t.same(
+ unitsToRanges('2,15,3,12,1,9,19,1C,1A,6,14,16,5,5-6,A,B,C,4,17-18,7-8'.split(',')),
+ '1-9;12;14-19;1A;1C;A;B;C',
+ 'complex real world data'
+ )
+
t.end()
})