additional malformed tests

Signed-off-by: Christian Goll <cgoll@suse.com>
This commit is contained in:
Christian Goll
2025-02-10 10:11:55 +01:00
parent 3b963ee5a6
commit 5cdaa515d9

View File

@@ -43,6 +43,26 @@ func TestHostList(t *testing.T) {
input: []string{"n[01-03]"}, input: []string{"n[01-03]"},
output: []string{"n01", "n02", "n03"}, output: []string{"n01", "n02", "n03"},
}, },
"double expansion": {
input: []string{"r[1-2]-n[3-4]"},
output: []string{"r1-n3", "r1-n4", "r2-n3", "r2-n4"},
},
"double expansion, with commas": {
input: []string{"r[1,2]-n[3,4]"},
output: []string{"r1-n3", "r1-n4", "r2-n3", "r2-n4"},
},
"wrong comma order": {
input: []string{"node[4,1]"},
output: []string{"node4", "node1"},
},
"wrong dash order": {
input: []string{"node[4-1]"},
output: nil,
},
"minus node": {
input: []string{"node[-1]"},
output: []string{"node0", "node1"},
},
} }
for name, tt := range tests { for name, tt := range tests {