Bugzilla – Attachment 59074 Details for
Bug 17880
C4::Installer::PerlModules lexicographical comparison is incorrect
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17880 - Add test to check version number comparison
Bug-17880---Add-test-to-check-version-number-compa.patch (text/plain), 1.66 KB, created by
Jonathan Druart
on 2017-01-17 09:23:11 UTC
(
hide
)
Description:
Bug 17880 - Add test to check version number comparison
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-01-17 09:23:11 UTC
Size:
1.66 KB
patch
obsolete
>From a0cf1f44edeb0c30806dc681b0c0e89c862aa99f Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Thu, 12 Jan 2017 11:14:34 +1100 >Subject: [PATCH] Bug 17880 - Add test to check version number comparison > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/Installer_PerlModules.t | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/t/Installer_PerlModules.t b/t/Installer_PerlModules.t >index 1d5a00c..fafdd48 100755 >--- a/t/Installer_PerlModules.t >+++ b/t/Installer_PerlModules.t >@@ -6,12 +6,22 @@ > use strict; > use warnings; > >-use Test::More tests => 17; >+use Test::More tests => 19; > > BEGIN { > use_ok('C4::Installer::PerlModules'); > } > >+$C4::Installer::PerlModules::PERL_DEPS->{'Local::Module::Sort'} = { >+ 'required' => '1', >+ 'min_ver' => '0.9.3', >+ 'usage' => "Testing: make sure numbers are compared numerically and not lexicographically", >+}; >+ >+$Local::Module::Sort::VERSION = '0.9.13'; >+$INC{"Local/Module/Sort.pm"} = 1; >+use_ok("Local::Module::Sort"); >+ > my $modules; > ok ($modules = C4::Installer::PerlModules->new(), 'Tests modules object'); > my $prereq_pm = $modules->prereq_pm(); >@@ -37,3 +47,5 @@ my @module_list = $modules->module_list; > ok (exists($params{"DBI"}), 'DBI exists in array'); > is ($modules->required('module'=>"String::Random"),1, 'String::Random should return 1 since required'); > ok (!$modules->version_info(), "Testing empty modules"); >+ >+is($modules->version_info('module'=>"Local::Module::Sort")->{"Local::Module::Sort"}->{"upgrade"},0,"Version 0.9.13 is greater than 0.9.3, so no upgrade needed"); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17880
:
58857
|
58858
|
58998
|
58999
| 59074 |
59075
|
59533
|
59534