fix ticketing system error on bootstrap of new install
[freeside.git] / rt / t / api / versions_sorter.t
1
2 use RT::Test nodata => 1, tests => 3;
3
4 use strict;
5 use warnings;
6
7 sub is_right_sorting {
8     my @order = @_;
9     my @tmp = sort { int(rand(3)) - 1 } @order;
10
11     is_deeply(
12         [ sort RT::Handle::cmp_version @tmp ],
13         \@order,
14         'test sorting of ('. join(' ', @tmp) .')'
15     );
16 }
17
18 is_right_sorting(qw(1 2 3));
19 is_right_sorting(qw(1.1 1.2 1.3 2.0 2.1));
20 is_right_sorting(qw(4.0.0a1 4.0.0alpha2 4.0.0b1 4.0.0beta2 4.0.0pre1 4.0.0pre2 4.0.0rc1 4.0.0rc2 4.0.0));
21