Skip to content

Commit

Permalink
Item11983:
Browse files Browse the repository at this point in the history
   * added back the two-newlines test again
   * added comments why the serializer is eating two newlines triggered by pathological META data left behind in the text area



git-svn-id: http://svn.foswiki.org/trunk@15401 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Sep 19, 2012
1 parent a5fd3c0 commit ea26ea3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions UnitTestContrib/test/unit/FuncTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ sub test_saveTopicRoundTrip {
'Tis some text
and a trailing newline
%META:FILEATTACHMENT{name="IMG_0608.JPG" attr="" autoattached="1" comment="A Comment" date="1162233146" size="762004" user="Main.AUser" version="1"}%
NONNY
Foswiki::Func::saveTopicText( $this->{test_web}, $topic, $origtext );
Expand Down
10 changes: 8 additions & 2 deletions UnitTestContrib/test/unit/MetaTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -593,13 +593,19 @@ GUNK
%META:TOPICMOVED{bad="bad"}%
$gunk
EVIL

my $topicObject =
Foswiki::Meta->new( $this->{session}, $this->{test_web}, "BadMeta",
$text );
$topicObject->save();

# All meta should have found its way into text
$this->assert_equals( $text, $topicObject->text() . "\n" );
$topicObject->save();

# SMELL: setEmbeddedStoreForm has been eating two newlines by now,
# yet the serializer refused to remove the bad META records either.
# ... a rather pathologiccal unit test.
$this->assert_equals( $text, $topicObject->text() . "\n\n" );

$topicObject->expandMacros( $topicObject->text() );
$topicObject->expandNewTopic();
$topicObject->renderTML( $topicObject->text() );
Expand Down

0 comments on commit ea26ea3

Please sign in to comment.