diff --git a/TablePlugin/test/unit/TablePlugin/TablePluginTests.pm b/TablePlugin/test/unit/TablePlugin/TablePluginTests.pm index b94f476a70..605a9f17ad 100755 --- a/TablePlugin/test/unit/TablePlugin/TablePluginTests.pm +++ b/TablePlugin/test/unit/TablePlugin/TablePluginTests.pm @@ -544,6 +544,137 @@ END $this->do_test( $expected, $result ); } + +=pod + +Tests that two tables have IDs suffixed by 1 and 2 + +=cut + +sub test_tableIdNumbering { + my $this = shift; + + my $cgi = $this->{request}; + my $url = $cgi->url( -absolute => 1 ); + my $expected = < + + + + + + + + + + + + + +
a b
2 3
+

+ + + + + + + + + + + + + + +
a b
2 3
+EXPECTED + my $actual = <do_test( $expected, $actual ); +} + + +=pod + +Tests that two tables have IDs suffixed by 1 and 1 if the +initialiseWhenRender is called between two calls to Foswiki::Func::renderText +(as used by rdiff and CompareRevisionsAddOn) where two revisions of same topic +is called twice. + +This test also tests the initialiseWhenRender API call + +=cut + +sub test_tableIdNumberingInitialiseWhenRender { + my $this = shift; + + my $webName = $this->{test_web}; + my $topicName = $this->{test_topic}; + my $expected = < + + + + + + + + + + + + + +
a b
2 3
+ + + + + + + + + + + + + + +
a b
2 3
+EXPECTED + my $actual = <assert_html_equals( $expected, $actual1 . $actual2 ); +} + + sub _trimSpaces { #my $text = $_[0]