@@ -230,6 +230,67 @@ func TestProcess(t *testing.T) {
230230 Aggregate : true ,
231231 },
232232 expectedOutput : []string {"10.0.0.0/32" , "10.0.0.2/31" },
233+ }, {
234+ name : "MultiOctetRangeExpansion" ,
235+ chancidr : make (chan string ),
236+ outputchan : make (chan string ),
237+ options : Options {
238+ FileCidr : []string {"192.168.0-1.1-2" },
239+ },
240+ expectedOutput : []string {
241+ "192.168.0.1" , "192.168.0.2" ,
242+ "192.168.1.1" , "192.168.1.2" ,
243+ },
244+ },
245+ {
246+ name : "MultiOctetRangeWithFilter" ,
247+ chancidr : make (chan string ),
248+ outputchan : make (chan string ),
249+ options : Options {
250+ FileCidr : []string {"192.168.0-1.1-2" },
251+ FilterIP : []string {"192.168.1.1" },
252+ },
253+ expectedOutput : []string {
254+ "192.168.0.1" , "192.168.0.2" ,
255+ "192.168.1.2" ,
256+ },
257+ },
258+ {
259+ name : "MultiOctetRangeAggregate" ,
260+ chancidr : make (chan string ),
261+ outputchan : make (chan string ),
262+ options : Options {
263+ FileCidr : []string {"10.0-1.0-1.0-1" },
264+ Aggregate : true ,
265+ },
266+ expectedOutput : []string {
267+ "10.0.0.0/31" , "10.0.1.0/31" ,
268+ "10.1.0.0/31" , "10.1.1.0/31" ,
269+ },
270+ },
271+ {
272+ name : "MultiOctetRangeSortAscending" ,
273+ chancidr : make (chan string ),
274+ outputchan : make (chan string ),
275+ options : Options {
276+ FileCidr : []string {"10.0.0-0.2-3" },
277+ SortAscending : true ,
278+ },
279+ expectedOutput : []string {
280+ "10.0.0.2" , "10.0.0.3" ,
281+ },
282+ },
283+ {
284+ name : "MultiOctetRangeSortDescending" ,
285+ chancidr : make (chan string ),
286+ outputchan : make (chan string ),
287+ options : Options {
288+ FileCidr : []string {"10.0.1-2.1" },
289+ SortDescending : true ,
290+ },
291+ expectedOutput : []string {
292+ "10.0.2.1" , "10.0.1.1" ,
293+ },
233294 },
234295 }
235296 var wg sync.WaitGroup
0 commit comments