Fixes: #13722 - Correct range expansion code when a numeric set is used (#15301)

* Fixes: #13722 - Correct range expansion code when a numeric set is used

* Correct to my own suggestion

* Clean up logic

* Simplify range detection

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
Daniel Sheppard
2024-03-11 09:50:10 -05:00
committed by GitHub
parent f0e137133f
commit 1ff4e1287f
2 changed files with 35 additions and 19 deletions

View File

@@ -191,7 +191,16 @@ class ExpandAlphanumeric(TestCase):
self.assertEqual(sorted(expand_alphanumeric_pattern(input)), output)
def test_set(self):
def test_set_numeric(self):
input = 'r[1,2]a'
output = sorted([
'r1a',
'r2a',
])
self.assertEqual(sorted(expand_alphanumeric_pattern(input)), output)
def test_set_alpha(self):
input = '[r,t]1a'
output = sorted([
'r1a',