Skip to content

Commit

Permalink
Item11135: Fix AddressTests for Foswiki 1.1
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@13851 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey authored and PaulHarvey committed Jan 28, 2012
1 parent 6a38e99 commit e5e0958
Showing 1 changed file with 35 additions and 9 deletions.
44 changes: 35 additions & 9 deletions UnitTestContrib/test/unit/AddressTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ our @ISA = qw( FoswikiTestCase );
use Assert;
use Data::Dumper;
use Benchmark qw(:hireswallclock);
use Foswiki::Address();
use constant TRACE => 0;

my $test_web = 'Temporary' . __PACKAGE__ . 'TestWeb';
Expand Down Expand Up @@ -269,8 +268,9 @@ sub set_up {

( $this->{test_topicObject} ) =
Foswiki::Func::readTopic( $this->{test_web}, $this->{test_topic} );
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
if ( $this->check_dependency('Foswiki,>=,1.2') ) {
require Foswiki::Address;
}

return;
}
Expand Down Expand Up @@ -352,15 +352,11 @@ HERE
return;
}

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

return;
}

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

$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
$this->gendata( \%test_roundtrip_range );
my %test_range = $this->gen_roundtrip_range_tests( \%test_roundtrip_range );

Expand Down Expand Up @@ -395,6 +391,8 @@ sub gen_testspec_fns {

no strict 'refs';
*{$fn} = sub {
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my $addrObj = Foswiki::Address->new( %{ $test->{atoms} } );
my $parsedaddrObj =
Foswiki::Address->new( string => $test->{string} );
Expand Down Expand Up @@ -514,6 +512,8 @@ sub _newAddrTestingWebpathParam {

sub test_meta1 {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my %constructor = (
web => "$test_web/SubWeb",
topic => 'Topic',
Expand All @@ -535,6 +535,8 @@ sub test_meta1 {

sub test_meta2 {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my %constructor = (
web => "$test_web/SubWeb",
topic => 'Topic',
Expand Down Expand Up @@ -565,6 +567,8 @@ sub test_meta2 {

sub test_meta3 {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my %constructor = (
web => "$test_web/SubWeb",
topic => 'Topic',
Expand All @@ -587,6 +591,8 @@ sub test_meta3 {

sub test_meta4 {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my %constructor = (
web => "$test_web/SubWeb",
topic => 'Topic',
Expand All @@ -609,6 +615,8 @@ sub test_meta4 {

sub test_chain_new_web {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my $addrObj = Foswiki::Address->new( web => 'Main', topic => 'WebHome' );
my $web = Foswiki::Address->new( web => 'Main', topic => 'WebHome' )->web();

Expand Down Expand Up @@ -654,6 +662,8 @@ sub test_timing_normaliseWebTopicName_default {

sub test_timing_normaliseWebTopicName_equiv {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my $addr;
my $benchmark = timeit(
10000,
Expand All @@ -672,6 +682,8 @@ sub test_timing_normaliseWebTopicName_equiv {

sub test_timing_normaliseWebTopicName_equiv_default {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my $addr;
my $benchmark = timeit(
10000,
Expand All @@ -691,6 +703,8 @@ sub test_timing_normaliseWebTopicName_equiv_default {

sub test_timing_creation {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my $addr;
my $benchmark = timeit(
100000,
Expand Down Expand Up @@ -731,6 +745,8 @@ sub test_timing_hashref_creation {

sub test_timing_reparse_default {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my $addr =
Foswiki::Address->new( topic => 'Topic', webpath => [qw(Web SubWeb)] );
my $benchmark = timeit(
Expand All @@ -751,6 +767,8 @@ sub test_timing_reparse_default {

sub test_timing_reparse {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my $addr =
Foswiki::Address->new( topic => 'Topic', webpath => [qw(Web SubWeb)] );
my $benchmark = timeit(
Expand Down Expand Up @@ -781,6 +799,8 @@ sub test_timing_reparse {

sub test_attachment_constructor_tompath {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my %constructor = (
web => "$test_web/SubWeb",
topic => 'Topic',
Expand All @@ -802,6 +822,8 @@ sub test_attachment_constructor_tompath {

sub test_attachment_constructor {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my %constructor = (
web => "$test_web/SubWeb",
topic => 'Topic',
Expand All @@ -823,6 +845,8 @@ sub test_attachment_constructor {

sub test_attachment_getsetters {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my %constructor = (
web => "$test_web/SubWeb",
topic => 'Topic',
Expand Down Expand Up @@ -851,6 +875,8 @@ sub test_attachment_getsetters {

sub test_root {
my ($this) = @_;
$this->expect_failure( 'Foswiki 1.1 has no Foswiki::Address',
with_dep => 'Foswiki,<,1.2' );
my %constructor = ( root => 1 );
my $addrObj = Foswiki::Address->new(%constructor);
my $parsedaddrObj = Foswiki::Address->new( string => "/" );
Expand Down

0 comments on commit e5e0958

Please sign in to comment.