Changeset 816 for trunk/UnitTestContrib/test/unit/Fn_SECTION.pm
- Timestamp:
- 11/19/08 19:11:33 (4 years ago)
- File:
-
- 1 edited
-
trunk/UnitTestContrib/test/unit/Fn_SECTION.pm (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitTestContrib/test/unit/Fn_SECTION.pm
r14 r816 5 5 package Fn_SECTION; 6 6 7 use base qw( TWikiFnTestCase );7 use base qw( FoswikiFnTestCase ); 8 8 9 use TWiki;9 use Foswiki; 10 10 use Error qw( :try ); 11 11 … … 25 25 # Named section closed without being opened 26 26 my $text = '0%ENDSECTION{"name"}%1'; 27 my( $nt, $s ) = TWiki::parseSections( $text );27 my( $nt, $s ) = Foswiki::parseSections( $text ); 28 28 $this->assert_str_equals("01",$nt); 29 29 $this->assert_str_equals('',dumpsec($s)); … … 35 35 # Named section opened but never closed 36 36 my $text = '0%STARTSECTION{"name"}%1'; 37 my ( $nt, $s ) = TWiki::parseSections( $text );37 my ( $nt, $s ) = Foswiki::parseSections( $text ); 38 38 $this->assert_str_equals("01",$nt); 39 39 $this->assert_str_equals('end="2" name="name" start="1" type="section"',dumpsec($s)); … … 45 45 # Unnamed section closed without being opened 46 46 my $text = '0%ENDSECTION%1'; 47 my ( $nt, $s ) = TWiki::parseSections( $text );47 my ( $nt, $s ) = Foswiki::parseSections( $text ); 48 48 $this->assert_str_equals("01",$nt); 49 49 $this->assert_str_equals('',dumpsec($s)); … … 55 55 # Unnamed section opened but never closed 56 56 my $text = '0%STARTSECTION%1'; 57 my ( $nt, $s ) = TWiki::parseSections( $text );57 my ( $nt, $s ) = Foswiki::parseSections( $text ); 58 58 $this->assert_str_equals("01",$nt); 59 59 $this->assert_str_equals('end="2" name="_SECTION0" start="1" type="section"',dumpsec($s)); … … 65 65 # Unnamed section closed by opening another section of the same type 66 66 my $text = '0%STARTSECTION%1%STARTSECTION%2'; 67 my ( $nt, $s ) = TWiki::parseSections( $text );67 my ( $nt, $s ) = Foswiki::parseSections( $text ); 68 68 $this->assert_str_equals("012",$nt); 69 69 $this->assert_str_equals('end="2" name="_SECTION0" start="1" type="section";end="3" name="_SECTION1" start="2" type="section"',dumpsec($s)); … … 75 75 # Named section overlaps unnamed section before it 76 76 my $text = '0%STARTSECTION%1%STARTSECTION{"named"}%2%ENDSECTION%3%ENDSECTION{"named"}%4'; 77 my ( $nt, $s ) = TWiki::parseSections( $text );77 my ( $nt, $s ) = Foswiki::parseSections( $text ); 78 78 $this->assert_str_equals("01234",$nt); 79 79 $this->assert_str_equals('end="2" name="_SECTION0" start="1" type="section";end="4" name="named" start="2" type="section"',dumpsec($s)); … … 85 85 # Named section overlaps unnamed section after it 86 86 my $text = '0%STARTSECTION{"named"}%1%STARTSECTION%2%ENDSECTION{"named"}%3%ENDSECTION%4'; 87 my ( $nt, $s ) = TWiki::parseSections( $text );87 my ( $nt, $s ) = Foswiki::parseSections( $text ); 88 88 $this->assert_str_equals("01234",$nt); 89 89 $this->assert_str_equals('end="3" name="named" start="1" type="section";end="4" name="_SECTION0" start="2" type="section"',dumpsec($s)); … … 95 95 # Unnamed sections of different types overlap 96 96 my $text = '0%STARTSECTION{type="include"}%1%STARTSECTION{type="templateonly"}%2%ENDSECTION{type="include"}%3%ENDSECTION{type="templateonly"}%4'; 97 my ( $nt, $s ) = TWiki::parseSections( $text );97 my ( $nt, $s ) = Foswiki::parseSections( $text ); 98 98 $this->assert_str_equals("01234",$nt); 99 99 $this->assert_str_equals('end="3" name="_SECTION0" start="1" type="include";end="4" name="_SECTION1" start="2" type="templateonly"',dumpsec($s)); … … 105 105 # Named sections of same type overlap 106 106 my $text = '0%STARTSECTION{"one"}%1%STARTSECTION{"two"}%2%ENDSECTION{"one"}%3%ENDSECTION{"two"}%4'; 107 my ( $nt, $s ) = TWiki::parseSections( $text );107 my ( $nt, $s ) = Foswiki::parseSections( $text ); 108 108 $this->assert_str_equals("01234",$nt); 109 109 $this->assert_str_equals('end="3" name="one" start="1" type="section";end="4" name="two" start="2" type="section"',dumpsec($s)); … … 115 115 # Named sections nested 116 116 my $text = '0%STARTSECTION{name="one"}%1%STARTSECTION{name="two"}%2%ENDSECTION{name="two"}%3%ENDSECTION{name="one"}%4'; 117 my ( $nt, $s ) = TWiki::parseSections( $text );117 my ( $nt, $s ) = Foswiki::parseSections( $text ); 118 118 $this->assert_str_equals("01234",$nt); 119 119 $this->assert_str_equals('end="4" name="one" start="1" type="section";end="3" name="two" start="2" type="section"',dumpsec($s));
Note: See TracChangeset
for help on using the changeset viewer.
