From f636c81824436a31c47ce164a59e1aeacfd6551d Mon Sep 17 00:00:00 2001 From: Andrew Harvey Date: Fri, 14 May 2021 16:01:33 +1000 Subject: handle duplicate units when converting to ranges --- test/unitsToRanges.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') diff --git a/test/unitsToRanges.js b/test/unitsToRanges.js index 2702b4a..7183ad1 100644 --- a/test/unitsToRanges.js +++ b/test/unitsToRanges.js @@ -87,5 +87,17 @@ test('units list to addr:flats', t => { 'different prefix not merged' ) + t.same( + unitsToRanges(['1', '1']), + '1', + 'source duplicates removed' + ) + + t.same( + unitsToRanges(['1', '1-2']), + '1-2', + 'source duplicates removed with range' + ) + t.end() }) -- cgit v1.2.3