Skip to content

Commit

Permalink
Item11168: Trying again, and add unit test
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@12703 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Oct 4, 2011
1 parent 22bd647 commit 9a9c1d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions UnitTestContrib/test/unit/DependencyTests.pm
Expand Up @@ -42,6 +42,17 @@ sub test_check_dep_not_module {

}

sub test_check_foswiki_rev {
my ($this) = @_;

my $dep = new Foswiki::Configure::Dependency(
type => 'perl', module => 'Foswiki', version => '1.1.3' );
my ( $ok, $message ) = $dep->check();
$this->assert_equals( 1, $ok );
$this->assert_matches( qr/^Foswiki version Foswiki-(.*) loaded$/, $message );

}

sub test_check_dep_carp {
my ($this) = @_;

Expand Down
4 changes: 2 additions & 2 deletions core/lib/Foswiki/Configure/Dependency.pm
Expand Up @@ -596,8 +596,8 @@ sub _decodeReleaseString {
@tuple = (0);
$form = 'tuple';
}
elsif ( $rel =~ /^Foswiki-(\d+)/ ) {
@tuple = ($1);
elsif ( $rel =~ /^Foswiki-(\d+([-_.]\d+)*).*?$/i ) {
@tuple = split( /[-_.]/, $1 );
$form = 'tuple';
}
else {
Expand Down

0 comments on commit 9a9c1d4

Please sign in to comment.