diff options
author | Nicolas Vigier <boklm@mageia.org> | 2011-01-06 01:07:55 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2011-01-06 01:07:55 +0000 |
commit | a4f149873af1e9cff9ab0829adfcd3eca1a3780d (patch) | |
tree | c1345b951f4c67e3e9c5bf57f984c3e9f901f17f /t/version.t | |
download | mga-youri-core-a4f149873af1e9cff9ab0829adfcd3eca1a3780d.tar mga-youri-core-a4f149873af1e9cff9ab0829adfcd3eca1a3780d.tar.gz mga-youri-core-a4f149873af1e9cff9ab0829adfcd3eca1a3780d.tar.bz2 mga-youri-core-a4f149873af1e9cff9ab0829adfcd3eca1a3780d.tar.xz mga-youri-core-a4f149873af1e9cff9ab0829adfcd3eca1a3780d.zip |
search in core, nonfree, tainted instead of main, contrib
Diffstat (limited to 't/version.t')
-rwxr-xr-x | t/version.t | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/t/version.t b/t/version.t new file mode 100755 index 0000000..d1ad0ae --- /dev/null +++ b/t/version.t @@ -0,0 +1,71 @@ +#!/usr/bin/perl +# $Id: version.t 1179 2006-08-05 08:30:57Z warly $ + +use Test::More; +use Youri::Check::Input::Updates; +use strict; + +my @differents = ( + [ '3.0.0', '1.0.0' ], + [ '3.0.0', '1.99.9' ], + [ '3.0.1', '3.0' ], + [ '3.0pl1', '3.0' ], + [ '3.0', '3.0beta1' ], + [ '3.0', '3.0beta' ], + [ '3.0', '3.0alpha1' ], + [ '3.0', '3.0alpha' ], + [ '3.0', '3.0pre1' ], + [ '3.0', '3.0pre' ], + [ '3.0pre', '3.0beta' ], + [ '3.0beta', '3.0alpha' ], + [ '1.0.0-p1', '1.0.0RC1' ], + [ '0.9.7f', '0.9.7e' ], + [ '10', '9' ], +); + +my @equals = ( + [ '1.0.0', '1.0.0' ], + [ '0.9Beta1', '0.9beta1' ], + [ '0.9beta1', '0.9 beta 1' ], + [ '0.3-alpha', '0.3_alpha' ], + [ '0.02', '.02' ], + [ '2.0.11', '15aug2000' ], + [ '2.0.11', '20060401' ], + [ '20', '20060401' ], +); + +plan tests => 2 * @differents + 2 * @equals; + +foreach my $different (@differents) { + ok( + Youri::Check::Input::Updates::is_newer( + $different->[0], + $different->[1] + ), + "$different->[0] is newer as $different->[1]" + ); + ok( + !Youri::Check::Input::Updates::is_newer( + $different->[1], + $different->[0] + ), + "$different->[1] is older as $different->[0]" + ); +} + +foreach my $equal (@equals) { + ok( + !Youri::Check::Input::Updates::is_newer( + $equal->[0], + $equal->[1] + ), + "$equal->[0] is equal as $equal->[1]" + ); + ok( + !Youri::Check::Input::Updates::is_newer( + $equal->[1], + $equal->[0] + ), + "$equal->[1] is equal as $equal->[0]" + ); +} |