Skip to content

Commit

Permalink
Item11708: Expect failure in 1.1 for 1.2 Store API fixes
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@15004 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey authored and PaulHarvey committed Jun 16, 2012
1 parent 5b39b20 commit 55fd2e5
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions UnitTestContrib/test/unit/StoreImplementationTests.pm
Expand Up @@ -26,7 +26,7 @@ use Foswiki ();
use Foswiki::Meta ();
use Error qw( :try );

my $data = "\0b\1l\2a\3h\4b\5l\6a\7h";
my $data = "\0b\1l\2a\3h\4b\5l\6a\7h";
my $data2 = "$data XXX $data";

sub set_up {
Expand Down Expand Up @@ -108,13 +108,13 @@ sub verify_simpleTopic {
$meta->finish();

$meta = Foswiki::Meta->new( $this->{session}, $web, $topic );
$this->{sut}->readTopic($meta, 1);
$this->assert_equals("1 2 3", $meta->text());
$this->{sut}->readTopic( $meta, 1 );
$this->assert_equals( "1 2 3", $meta->text() );
$meta->finish();

$meta = Foswiki::Meta->new( $this->{session}, $web, $topic );
$this->{sut}->readTopic($meta, 2);
$this->assert_equals("4 5 6", $meta->text());
$this->{sut}->readTopic( $meta, 2 );
$this->assert_equals( "4 5 6", $meta->text() );
$meta->finish();

return;
Expand Down Expand Up @@ -202,7 +202,7 @@ sub verify_getRevisionDiff {
}
else {
$expect = [
[ 'l', '1', '1' ],
[ 'l', '1', '1' ],
[ 'u', 'This is some test text', 'This is some test text' ],
[ 'u', ' * some list', ' * some list' ],
[ '-', ' * maladjusted', '' ],
Expand Down Expand Up @@ -257,6 +257,8 @@ sub verify_getRevisionInfo {
my $info = $this->{sut}->getVersionInfo($readMeta);
$this->assert_num_equals( 2, $info->{version} );
$info = $this->{sut}->getVersionInfo( $readMeta, 1 );
$this->expect_failure( 'Item11708 Store API fixed in Foswiki 1.2+',
with_dep => 'Foswiki,<,1.2' );
$this->assert_num_equals( 1, $info->{version} );

$this->removeFromStore($web);
Expand Down Expand Up @@ -369,8 +371,10 @@ sub verify_repRevTopic {
# with the date - there's can't be an earlier rev.
$this->{sut}->repRev( $meta, $this->{test_user_cuid}, forcedate => 1000 );
my $info = $this->{sut}->getVersionInfo($meta);
$this->assert( $info->{date} - 1000 < 5, $info->{date} );
$this->assert_num_equals( 1, $info->{version} );
$this->expect_failure( 'Item11708 Store API fixed in Foswiki 1.2+',
with_dep => 'Foswiki,<,1.2' );
$this->assert( $info->{date} - 1000 < 5, $info->{date} );

# SMELL: Following test commented out because RcsWrap and RcsLite both fail when
# forcedate is used
Expand Down Expand Up @@ -467,15 +471,17 @@ sub verify_openAttachment {
Foswiki::Meta->new( $this->{session}, $this->{t_web}, $this->{t_topic} );

local $/;
my $f = $this->{sut}->openAttachment($meta, "testfile.gif", "<");
$this->assert_equals($data2, <$f>);
my $f = $this->{sut}->openAttachment( $meta, "testfile.gif", "<" );
$this->assert_equals( $data2, <$f> );
close($f);

$f = $this->{sut}->openAttachment($meta, "testfile.gif", "<", version => 1);
$this->assert_equals($data, <$f>);
$f =
$this->{sut}->openAttachment( $meta, "testfile.gif", "<", version => 1 );
$this->assert_equals( $data, <$f> );
close($f);
$f = $this->{sut}->openAttachment($meta, "testfile.gif", "<", version => 2);
$this->assert_equals($data2, <$f>);
$f =
$this->{sut}->openAttachment( $meta, "testfile.gif", "<", version => 2 );
$this->assert_equals( $data2, <$f> );
close($f);

return;
Expand Down

0 comments on commit 55fd2e5

Please sign in to comment.