In naturalsort there is handling for Float, Decimal and Scientific notation. This looks for numbers like: '10.04f','10.039F','10.038d','1.528535047e5' It was breaking port sorting for ports named like "D1", "D10" etc. Have removed support for sorting these numbers as it's unlikely we need that in Netdisco, for now.
		
			
				
	
	
		
			19 lines
		
	
	
		
			413 B
		
	
	
	
		
			Perl
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			413 B
		
	
	
	
		
			Perl
		
	
	
	
	
	
| #!/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');
 | |
| is(sort_port('D1','D10'), -1, 'HP - simple letter and number [#152]');
 | |
| 
 | |
| done_testing;
 |