Changeset 9846
- Timestamp:
- 11/04/10 00:29:59 (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Release01x01/UnitTestContrib/test/unit/FuncTests.pm
r9596 r9846 380 380 Foswiki::Func::saveTopicText( $this->{test_web}, $topic, 'Beam', 1 ); 381 381 $this->assert( !$oopsURL, $oopsURL ); 382 } 383 384 # Verify that a round trip doesn't remove or add any newlines between the topic and 385 # the metadata in the raw text. 386 sub test_saveTopicRoundTrip { 387 my $this = shift; 388 my $topic = 'SaveTopicText2'; 389 my $origtext = <<NONNY; 390 'Tis some text 391 and a trailing newline 392 393 394 395 %META:FILEATTACHMENT{name="IMG_0608.JPG" attr="" autoattached="1" comment="A Comment" date="1162233146" size="762004" user="Main.AUser" version="1"}% 396 NONNY 397 Foswiki::Func::saveTopicText( $this->{test_web}, $topic, $origtext ); 398 my $text1 = Foswiki::Func::readTopicText( $this->{test_web}, $topic ); 399 400 my ( $meta, $text ) = Foswiki::Func::readTopic( $this->{test_web}, $topic ); 401 Foswiki::Func::saveTopic( $this->{test_web}, $topic, $meta, $text, 402 { comment => 'atp save' } ); 403 my $text2 = Foswiki::Func::readTopicText( $this->{test_web}, $topic ); 404 405 my $matchText = '%META:TOPICINFO{author="BaseUserMapping_666" comment="save topic" date=".*?" format="1.1" reprev="1" version="1"}%' . "\n" . $origtext; 406 $this->assert_matches( qr/$matchText/, $text2 ); 407 382 408 } 383 409
Note: See TracChangeset
for help on using the changeset viewer.
