fix Port sort order for Extreme switches "1:10" format
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
* [#58] Search by VLAN name now works (R. Kerr)
|
||||
* Make "Not" option work for vlan number search in Device Ports
|
||||
* [#48] Fix for netmap links when domain_suffix is set (R. Kerr)
|
||||
* [#57] Port sort order for Extreme switches "1:10" format
|
||||
|
||||
2.020002 - 2013-12-11
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ sub sort_port {
|
||||
|
||||
my $numbers = qr{^(\d+)$};
|
||||
my $numeric = qr{^([\d\.]+)$};
|
||||
my $dotted_numeric = qr{^(\d+)\.(\d+)$};
|
||||
my $dotted_numeric = qr{^(\d+)[:.](\d+)$};
|
||||
my $letter_number = qr{^([a-zA-Z]+)(\d+)$};
|
||||
my $wordcharword = qr{^([^:\/.]+)[-\ :\/\.]+([^:\/.0-9]+)(\d+)?$}; #port-channel45
|
||||
my $netgear = qr{^Slot: (\d+) Port: (\d+) }; # "Slot: 0 Port: 15 Gigabit - Level"
|
||||
|
||||
17
Netdisco/t/10-sort_port.t
Normal file
17
Netdisco/t/10-sort_port.t
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict; use warnings FATAL => 'all';
|
||||
use Test::More 0.88;
|
||||
|
||||
BEGIN {
|
||||
use_ok( 'App::Netdisco::Util::Web', 'sort_port' );
|
||||
}
|
||||
|
||||
# 1 = first is greater
|
||||
# 0 = same
|
||||
# -1 = first is lesser
|
||||
|
||||
is(sort_port(1,1), 0, 'number - same values');
|
||||
is(sort_port('1:2','1:10'), -1, 'colon number (Extreme) - first lesser');
|
||||
|
||||
done_testing;
|
||||
Reference in New Issue
Block a user