Skip to content

Commit

Permalink
Item9041: Show that TCP's link-patching is broken
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@7930 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelTempest authored and MichaelTempest committed Jun 26, 2010
1 parent ee69d6b commit ecf1c65
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
Expand Up @@ -6,7 +6,7 @@ use warnings;
use Unit::TestSuite;
our @ISA = 'Unit::TestSuite';

sub include_tests { return 'TWikiFuncTests' }
sub include_tests { return 'TWikiFuncTests', 'TWikiLinkTests' }

1;
__END__
Expand Down
@@ -0,0 +1,38 @@
#
# Unit tests for handling of links
#

package TWikiLinkTests;
use FoswikiFnTestCase;
our @ISA = qw( FoswikiFnTestCase );

use strict;
use Foswiki::Func;

sub new {
my $self = shift()->SUPER::new( "Link", @_ );
return $self;
}

sub test_renamedMainTopic {
my $this = shift;
my $goodLink = Foswiki::Func::renderText('Main.SitePreferences');
my $oldLink = Foswiki::Func::renderText('Main.TWikiPreferences');
$this->assert_str_equals($goodLink, $oldLink);
}

sub test_renamedSystemTopic {
my $this = shift;
my $goodLink = Foswiki::Func::renderText('System.BeginnersStartHere');
my $oldLink = Foswiki::Func::renderText('TWiki.ATasteOfTWiki');
$this->assert_str_equals($goodLink, $oldLink);
}

sub test_renamedSystemTopicWithLinkText {
my $this = shift;
my $goodLink = Foswiki::Func::renderText('[[System.BeginnersStartHere][Link Text]]');
my $oldLink = Foswiki::Func::renderText('[[TWiki.ATasteOfTWiki][Link Text]]');
$this->assert_str_equals($goodLink, $oldLink);
}

1;

0 comments on commit ecf1c65

Please sign in to comment.