Ignore:
Timestamp:
01/27/12 04:43:16 (4 months ago)
Author:
PaulHarvey
Message:

Item11456: Finally, sync Fn_SEARCH

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Release01x01/UnitTestContrib/test/unit/Fn_SEARCH.pm

    r13729 r13835  
    11# tests for the correct expansion of SEARCH 
    22# SMELL: this test is pathetic, becase SEARCH has dozens of untested modes 
    3  
     3# 
     4# In order to keep this test down to a manageable run time, the fixture 
     5# groups are only applied to those tests where we are testing the correct 
     6# parsing of the search expression and its correct application in searching. 
     7# Where we are primarily testing formatting and pagination, we keep the 
     8# test out of the fixture groups on the assumption that all search and 
     9# query algorithms output is formatted by the same code. 
     10# 
     11# NOTE: When developing, or after modifying search or query algorithms, 
     12# you are highly recommended to run this suite with the "test" functions 
     13# converted to "verify" - just in case! 
     14# 
    415package Fn_SEARCH; 
    516 
     
    718use warnings; 
    819 
    9 use FoswikiFnTestCase; 
     20use FoswikiFnTestCase(); 
    1021our @ISA = qw( FoswikiFnTestCase ); 
    1122 
    12 use Foswiki; 
     23use Foswiki(); 
    1324use Error qw( :try ); 
    1425use Assert; 
    15 use Foswiki::Search; 
    16 use Foswiki::Search::InfoCache; 
    17 use Foswiki::Render; 
     26use English qw( -no_match_vars ); 
     27use Foswiki::Search(); 
     28use Foswiki::Search::InfoCache(); 
    1829 
    1930use File::Spec qw(case_tolerant) 
     
    2132 
    2233sub new { 
    23     my $self = shift()->SUPER::new( 'SEARCH', @_ ); 
     34    my ( $class, @args ) = @_; 
     35    my $self = $class->SUPER::new( 'SEARCH', @args ); 
     36 
    2437    return $self; 
    2538} 
     
    3447 
    3548sub set_up { 
    36     my $this = shift; 
    37  
    38     $this->SUPER::set_up(); 
    39  
    40     my $topicObject = 
    41       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'OkTopic', 
    42         "BLEEGLE blah/matchme.blah" ); 
    43     $topicObject->save(); 
    44     $topicObject = 
    45       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'OkATopic', 
    46         "BLEEGLE dontmatchme.blah" ); 
    47     $topicObject->save(); 
    48     $topicObject = 
    49       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'OkBTopic', 
    50         "BLEEGLE dont.matchmeblah" ); 
    51     $topicObject->save(); 
     49    my ($this) = shift; 
     50    $this->SUPER::set_up(@_); 
     51 
     52    my $timestamp = time(); 
     53 
     54    my ($topicObject) = 
     55      Foswiki::Func::readTopic( $this->{test_web}, 'OkTopic' ); 
     56    $topicObject->text("BLEEGLE blah/matchme.blah"); 
     57    $topicObject->save( forcedate => $timestamp + 120 ); 
     58    $topicObject->finish(); 
     59    ($topicObject) = Foswiki::Func::readTopic( $this->{test_web}, 'OkATopic' ); 
     60    $topicObject->text("BLEEGLE dontmatchme.blah"); 
     61    $topicObject->save( forcedate => $timestamp + 240 ); 
     62    $topicObject->finish(); 
     63    ($topicObject) = Foswiki::Func::readTopic( $this->{test_web}, 'OkBTopic' ); 
     64    $topicObject->text("BLEEGLE dont.matchmeblah"); 
     65    $topicObject->save( forcedate => $timestamp + 480 ); 
     66    $topicObject->finish(); 
     67 
     68    ($topicObject) = 
     69      Foswiki::Func::readTopic( $this->{test_web}, 'InvisibleTopic' ); 
     70    $topicObject->text("BLEEGLE dont.matchmeblah"); 
     71    $topicObject->putKeyed( 'PREFERENCE', 
     72        { name => 'ALLOWTOPICVIEW', value => 'OnlySuperman' } ); 
     73    $topicObject->save( forcedate => $timestamp + 480 ); 
     74    $topicObject->finish(); 
     75 
     76    return; 
    5277} 
    5378 
     
    6085                next unless $alg =~ /^(.*)\.pm$/; 
    6186                $alg = $1; 
    62                 if ( $^O eq 'MSWin32' ) { 
    63  
    64                    #skip forking search for now, its extremely broken on windows 
    65                     next if ( $alg eq 'Forking' ); 
    66                 } 
     87 
     88                # skip forking search for now, its extremely broken 
     89                # on windows 
     90                next if ( $^O eq 'MSWin32' && $alg eq 'Forking' ); 
    6791                $salgs{$alg} = 1; 
    6892            } 
     
    82106        my $fn = $alg . 'Search'; 
    83107        push( @groups, $fn ); 
    84         next if ( defined(&$fn) ); 
    85         eval <<SUB; 
     108        next if ( defined( &{$fn} ) ); 
     109        if ( not eval <<"SUB" or $EVAL_ERROR ) { 
    86110sub $fn { 
    87 require Foswiki::Store::SearchAlgorithms::$alg; 
    88 \$Foswiki::cfg{Store}{SearchAlgorithm} = 'Foswiki::Store::SearchAlgorithms::$alg'; } 
     111    require Foswiki::Store::SearchAlgorithms::$alg; 
     112    \$Foswiki::cfg{Store}{SearchAlgorithm} = 'Foswiki::Store::SearchAlgorithms::$alg'; 
     113} 
     1141; 
    89115SUB 
    90         die $@ if $@; 
     116            die $EVAL_ERROR; 
     117        } 
    91118    } 
    92119    foreach my $alg ( keys %qalgs ) { 
     
    94121        push( @groups, $fn ); 
    95122        next if ( defined(&$fn) ); 
    96         eval <<SUB; 
     123        if ( not eval <<"SUB" or $EVAL_ERROR ) { 
    97124sub $fn { 
    98 require Foswiki::Store::QueryAlgorithms::$alg; 
    99 \$Foswiki::cfg{Store}{QueryAlgorithm} = 'Foswiki::Store::QueryAlgorithms::$alg'; } 
     125    require Foswiki::Store::QueryAlgorithms::$alg; 
     126    \$Foswiki::cfg{Store}{QueryAlgorithm} = 'Foswiki::Store::QueryAlgorithms::$alg'; 
     127} 
     1281; 
    100129SUB 
    101         die $@ if $@; 
     130            die $EVAL_ERROR; 
     131        } 
    102132    } 
    103133 
    104     return \@groups; 
     134    return ( \@groups ); 
    105135} 
    106136 
    107137sub loadExtraConfig { 
     138    my ( $this, $context, @args ) = @_;    # the Test::Unit::TestCase object 
     139 
     140    $this->SUPER::loadExtraConfig( $context, @args ); 
     141 
     142#turn on the MongoDBPlugin so that the saved data goes into mongoDB 
     143#This is temoprary until Crawford and I cna find a way to push dependencies into unit tests 
     144    if (   ( $Foswiki::cfg{Store}{SearchAlgorithm} =~ /MongoDB/ ) 
     145        or ( $Foswiki::cfg{Store}{QueryAlgorithm} =~ /MongoDB/ ) 
     146        or ( $context =~ /MongoDB/ ) ) 
     147    { 
     148        $Foswiki::cfg{Plugins}{MongoDBPlugin}{Module} = 
     149          'Foswiki::Plugins::MongoDBPlugin'; 
     150        $Foswiki::cfg{Plugins}{MongoDBPlugin}{Enabled}             = 1; 
     151        $Foswiki::cfg{Plugins}{MongoDBPlugin}{EnableOnSaveUpdates} = 1; 
     152 
     153#push(@{$Foswiki::cfg{Store}{Listeners}}, 'Foswiki::Plugins::MongoDBPlugin::Listener'); 
     154        $Foswiki::cfg{Store}{Listeners} 
     155          {'Foswiki::Plugins::MongoDBPlugin::Listener'} = 1; 
     156        require Foswiki::Plugins::MongoDBPlugin; 
     157        Foswiki::Plugins::MongoDBPlugin::getMongoDB() 
     158          ->remove( $this->{test_web}, 'current', 
     159            { '_web' => $this->{test_web} } ); 
     160    } 
     161 
     162    return; 
     163} 
     164 
     165sub tear_down { 
    108166    my $this = shift;    # the Test::Unit::TestCase object 
    109     $this->SUPER::loadExtraConfig(); 
     167 
     168    $this->SUPER::tear_down(@_); 
     169 
     170    #need to clear the web every test? 
     171    if (   ( $Foswiki::cfg{Store}{SearchAlgorithm} =~ /MongoDB/ ) 
     172        or ( $Foswiki::cfg{Store}{QueryAlgorithm} =~ /MongoDB/ ) ) 
     173    { 
     174        require Foswiki::Plugins::MongoDBPlugin; 
     175        Foswiki::Plugins::MongoDBPlugin::getMongoDB() 
     176          ->remove( $this->{test_web}, 'current', 
     177            { '_web' => $this->{test_web} } ); 
     178    } 
     179 
     180    return; 
    110181} 
    111182 
     
    121192    $this->assert_matches( qr/OkBTopic/, $result ); 
    122193    $this->assert_matches( qr/OkATopic/, $result ); 
     194 
     195    return; 
    123196} 
    124197 
     
    131204 
    132205    $this->assert_str_equals( '', $result ); 
     206 
     207    return; 
    133208} 
    134209 
     
    145220    $this->assert_does_not_match( qr/OkBTopic/, $result ); 
    146221    $this->assert_does_not_match( qr/OkATopic/, $result ); 
     222 
     223    return; 
    147224} 
    148225 
     
    160237    $this->assert_matches( qr/OkBTopic/, $result ); 
    161238    $this->assert_matches( qr/OkATopic/, $result ); 
     239 
     240    return; 
    162241} 
    163242 
     
    173252    $this->assert_matches( qr/OkBTopic/, $result ); 
    174253    $this->assert_matches( qr/OkATopic/, $result ); 
     254 
     255    return; 
    175256} 
    176257 
     
    188269    $this->assert_matches( qr/OkBTopic/, $result ); 
    189270    $this->assert_matches( qr/OkATopic/, $result ); 
     271 
     272    return; 
    190273} 
    191274 
     
    203286    $this->assert_matches( qr/OkBTopic/, $result ); 
    204287    $this->assert_matches( qr/OkATopic/, $result ); 
     288 
     289    return; 
    205290} 
    206291 
     
    220305    # 'blah' is in OkATopic, but not as a word 
    221306    $this->assert_does_not_match( qr/OkBTopic/, $result, $result ); 
     307 
     308    return; 
    222309} 
    223310 
     
    225312    my $this = shift; 
    226313 
    227     my $topicObject = 
    228       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'VirtualBeer', 
    229         "There are alot of Virtual Beers to go around" ); 
     314    my ($topicObject) = 
     315      Foswiki::Func::readTopic( $this->{test_web}, 'VirtualBeer' ); 
     316    $topicObject->text("There are alot of Virtual Beers to go around"); 
    230317    $topicObject->save(); 
    231     $topicObject = 
    232       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'RealBeer', 
    233         "There are alot of Virtual Beer to go around" ); 
     318    $topicObject->finish(); 
     319    ($topicObject) = Foswiki::Func::readTopic( $this->{test_web}, 'RealBeer' ); 
     320    $topicObject->text("There are alot of Virtual Beer to go around"); 
    234321    $topicObject->save(); 
    235     $topicObject = 
    236       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'FamouslyBeered', 
    237         "Virtually speaking there could be alot of famous Beers" ); 
     322    $topicObject->finish(); 
     323    ($topicObject) = 
     324      Foswiki::Func::readTopic( $this->{test_web}, 'FamouslyBeered' ); 
     325    $topicObject->text( 
     326        "Virtually speaking there could be alot of famous Beers"); 
    238327    $topicObject->save(); 
    239     $topicObject = 
    240       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'VirtualLife', 
    241         "In a all life, I would expect to find fine Beer" ); 
     328    $topicObject->finish(); 
     329    ($topicObject) = 
     330      Foswiki::Func::readTopic( $this->{test_web}, 'VirtualLife' ); 
     331    $topicObject->text("In a all life, I would expect to find fine Beer"); 
    242332    $topicObject->save(); 
     333    $topicObject->finish(); 
    243334 
    244335    my $result = 
     
    247338      ); 
    248339 
    249     my $expected = <<EXPECT; 
     340    my $expected = <<'EXPECT'; 
    250341RealBeer 
    251342VirtualBeer 
     
    253344EXPECT 
    254345    $this->assert_str_equals( $expected, $result . "\n" ); 
     346 
     347    return; 
    255348} 
    256349 
     
    258351    my $this = shift; 
    259352 
    260     my $topicObject = 
    261       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'VirtualBeer', 
    262         "There are alot of Virtual Beers to go around" ); 
     353    my ($topicObject) = 
     354      Foswiki::Func::readTopic( $this->{test_web}, 'VirtualBeer' ); 
     355    $topicObject->text("There are alot of Virtual Beers to go around"); 
    263356    $topicObject->save(); 
    264     $topicObject = 
    265       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'RealBeer', 
    266         "There are alot of Virtual Beer to go around" ); 
     357    $topicObject->finish(); 
     358    ($topicObject) = Foswiki::Func::readTopic( $this->{test_web}, 'RealBeer' ); 
     359    $topicObject->text("There are alot of Virtual Beer to go around"); 
    267360    $topicObject->save(); 
    268     $topicObject = 
    269       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'FamouslyBeered', 
    270         "Virtually speaking there could be alot of famous Beers" ); 
     361    $topicObject->finish(); 
     362    ($topicObject) = 
     363      Foswiki::Func::readTopic( $this->{test_web}, 'FamouslyBeered' ); 
     364    $topicObject->text( 
     365        "Virtually speaking there could be alot of famous Beers"); 
    271366    $topicObject->save(); 
    272     $topicObject = 
    273       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'VirtualLife', 
    274         "In a all life, I would expect to find fine Beer" ); 
     367    $topicObject->finish(); 
     368    ($topicObject) = 
     369      Foswiki::Func::readTopic( $this->{test_web}, 'VirtualLife' ); 
     370    $topicObject->text("In a all life, I would expect to find fine Beer"); 
    275371    $topicObject->save(); 
     372    $topicObject->finish(); 
    276373 
    277374    my $result = 
     
    280377      ); 
    281378 
    282     my $expected = <<EXPECT; 
     379    my $expected = <<'EXPECT'; 
    283380FamouslyBeered 
    284381RealBeer 
     
    287384EXPECT 
    288385    $this->assert_str_equals( $expected, $result . "\n" ); 
     386 
     387    return; 
    289388} 
    290389 
     
    292391    my $this = shift; 
    293392 
    294     my $topicObject = 
    295       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'VirtualBeer', 
    296         "There are alot of Virtual Beers to go around" ); 
     393    my ($topicObject) = 
     394      Foswiki::Func::readTopic( $this->{test_web}, 'VirtualBeer' ); 
     395    $topicObject->text("There are alot of Virtual Beers to go around"); 
    297396    $topicObject->save(); 
    298     $topicObject = 
    299       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'RealBeer', 
    300         "There are alot of Virtual Beer to go around" ); 
     397    $topicObject->finish(); 
     398    ($topicObject) = Foswiki::Func::readTopic( $this->{test_web}, 'RealBeer' ); 
     399    $topicObject->text("There are alot of Virtual Beer to go around"); 
    301400    $topicObject->save(); 
    302     $topicObject = 
    303       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'FamouslyBeered', 
    304         "Virtually speaking there could be alot of famous Beers" ); 
     401    $topicObject->finish(); 
     402    ($topicObject) = 
     403      Foswiki::Func::readTopic( $this->{test_web}, 'FamouslyBeered' ); 
     404    $topicObject->text( 
     405        "Virtually speaking there could be alot of famous Beers"); 
    305406    $topicObject->save(); 
    306     $topicObject = 
    307       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'VirtualLife', 
    308         "In a all life, I would expect to find fine Beer" ); 
     407    $topicObject->finish(); 
     408    ($topicObject) = 
     409      Foswiki::Func::readTopic( $this->{test_web}, 'VirtualLife' ); 
     410    $topicObject->text("In a all life, I would expect to find fine Beer"); 
    309411    $topicObject->save(); 
     412    $topicObject->finish(); 
    310413 
    311414    my $result = 
     
    314417      ); 
    315418 
    316     my $expected = <<EXPECT; 
     419    my $expected = <<'EXPECT'; 
    317420RealBeer 
    318421VirtualBeer 
    319422EXPECT 
    320423    $this->assert_str_equals( $expected, $result . "\n" ); 
    321 } 
     424 
     425    return; 
     426} 
     427 
     428sub _expect_with_deps { 
     429    my ( $this, $default, %expectations ) = @_; 
     430    my @deps = sort( keys %expectations ); 
     431    my $expected; 
     432    my $checking = 1; 
     433 
     434    while ( $checking && scalar(@deps) ) { 
     435        my $dep = shift(@deps); 
     436 
     437        if ( $this->check_dependency($dep) ) { 
     438            $expected = $expectations{$dep}; 
     439            $checking = 0; 
     440        } 
     441    } 
     442    if ($checking) { 
     443        $expected = $default; 
     444    } 
     445 
     446    return $expected; 
     447} 
     448 
     449# Verify that the default result orering is independent of the web= and 
     450# topic= parameters 
     451sub verify_default_alpha_order_query { 
     452    my $this   = shift; 
     453    my $result = $this->{test_topicObject}->expandMacros( 
     454        '%SEARCH{ 
     455                "1"  
     456                type="query" 
     457                web="System,Main,Sandbox" 
     458                topic="WebSearch,WebHome,WebPreferences" 
     459                nonoise="on"  
     460                format="$web.$topic" 
     461        }%' 
     462    ); 
     463    my $expected = $this->_expect_with_deps( 
     464        <<'FOSWIKI12', 
     465Main.WebHome 
     466Main.WebPreferences 
     467Main.WebSearch 
     468Sandbox.WebHome 
     469Sandbox.WebPreferences 
     470Sandbox.WebSearch 
     471System.WebHome 
     472System.WebPreferences 
     473System.WebSearch 
     474FOSWIKI12 
     475        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
     476System.WebHome 
     477System.WebPreferences 
     478System.WebSearch 
     479Main.WebHome 
     480Main.WebPreferences 
     481Main.WebSearch 
     482Sandbox.WebHome 
     483Sandbox.WebPreferences 
     484Sandbox.WebSearch 
     485FOSWIKI11 
     486    $expected =~ s/\n$//s; 
     487    $this->assert_str_equals( $expected, $result ); 
     488 
     489    return; 
     490} 
     491 
     492sub verify_default_alpha_order_search { 
     493    my $this   = shift; 
     494    my $result = $this->{test_topicObject}->expandMacros( 
     495        '%SEARCH{ 
     496                "."  
     497                type="regex" 
     498                web="System,Main,Sandbox" 
     499                topic="WebSearch,WebHome,WebPreferences" 
     500                nonoise="on"  
     501                format="$web.$topic" 
     502        }%' 
     503    ); 
     504    my $expected = $this->_expect_with_deps( 
     505        <<'FOSWIKI12', 
     506Main.WebHome 
     507Main.WebPreferences 
     508Main.WebSearch 
     509Sandbox.WebHome 
     510Sandbox.WebPreferences 
     511Sandbox.WebSearch 
     512System.WebHome 
     513System.WebPreferences 
     514System.WebSearch 
     515FOSWIKI12 
     516        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
     517System.WebHome 
     518System.WebPreferences 
     519System.WebSearch 
     520Main.WebHome 
     521Main.WebPreferences 
     522Main.WebSearch 
     523Sandbox.WebHome 
     524Sandbox.WebPreferences 
     525Sandbox.WebSearch 
     526FOSWIKI11 
     527    $expected =~ s/\n$//s; 
     528    $this->assert_str_equals( $expected, $result ); 
     529 
     530    return; 
     531} 
     532 
    322533##################### 
    323534sub _septic { 
     
    333544    $expected =~ s/\n$//s; 
    334545    $this->assert_str_equals( $expected, $result ); 
     546 
     547    return; 
    335548} 
    336549 
    337550##################### 
    338551 
    339 sub verify_no_header_no_footer_no_separator_with_results { 
    340     my $this = shift; 
    341     $this->_septic( 0, 0, undef, 1, <<EXPECT); 
     552sub test_no_header_no_footer_no_separator_with_results { 
     553    my $this = shift; 
     554    $this->_septic( 0, 0, undef, 1, <<'EXPECT'); 
    342555OkATopic 
    343556OkBTopic 
    344557OkTopic 
    345558EXPECT 
    346 } 
    347  
    348 sub verify_no_header_no_footer_no_separator_no_results { 
    349     my $this = shift; 
    350     $this->_septic( 0, 0, undef, 0, <<EXPECT); 
     559 
     560    return; 
     561} 
     562 
     563sub test_no_header_no_footer_no_separator_no_results { 
     564    my $this = shift; 
     565    $this->_septic( 0, 0, undef, 0, <<'EXPECT'); 
    351566EXPECT 
    352 } 
    353  
    354 sub verify_no_header_no_footer_empty_separator_with_results { 
    355     my $this = shift; 
    356     $this->_septic( 0, 0, "", 1, <<EXPECT); 
     567 
     568    return; 
     569} 
     570 
     571sub test_no_header_no_footer_empty_separator_with_results { 
     572    my $this = shift; 
     573    $this->_septic( 0, 0, "", 1, <<'EXPECT'); 
    357574OkATopicOkBTopicOkTopic 
    358575EXPECT 
    359 } 
    360  
    361 sub verify_no_header_no_footer_empty_separator_no_results { 
    362     my $this = shift; 
    363     $this->_septic( 0, 0, "", 0, <<EXPECT); 
     576 
     577    return; 
     578} 
     579 
     580sub test_no_header_no_footer_empty_separator_no_results { 
     581    my $this = shift; 
     582    $this->_septic( 0, 0, "", 0, <<'EXPECT'); 
    364583EXPECT 
    365 } 
    366  
    367 sub verify_no_header_no_footer_with_separator_with_results { 
    368     my $this = shift; 
    369     $this->_septic( 0, 0, ",", 1, <<EXPECT); 
     584 
     585    return; 
     586} 
     587 
     588sub test_no_header_no_footer_with_separator_with_results { 
     589    my $this = shift; 
     590    $this->_septic( 0, 0, ",", 1, <<'EXPECT'); 
    370591OkATopic,OkBTopic,OkTopic 
    371592EXPECT 
    372 } 
    373  
    374 sub verify_no_header_no_footer_with_nl_separator_with_results { 
    375     my $this = shift; 
    376     $this->_septic( 0, 0, '$n', 1, <<EXPECT); 
     593 
     594    return; 
     595} 
     596 
     597sub test_no_header_no_footer_with_nl_separator_with_results { 
     598    my $this = shift; 
     599    $this->_septic( 0, 0, '$n', 1, <<'EXPECT'); 
    377600OkATopic 
    378601OkBTopic 
    379602OkTopic 
    380603EXPECT 
    381 } 
    382  
    383 sub verify_no_header_no_footer_with_separator_no_results { 
    384     my $this = shift; 
    385     $this->_septic( 0, 0, ",", 0, <<EXPECT); 
     604 
     605    return; 
     606} 
     607 
     608sub test_no_header_no_footer_with_separator_no_results { 
     609    my $this = shift; 
     610    $this->_septic( 0, 0, ",", 0, <<'EXPECT'); 
    386611EXPECT 
     612 
     613    return; 
    387614} 
    388615##################### 
    389616 
    390 sub verify_no_header_with_footer_no_separator_with_results { 
    391     my $this = shift; 
    392     $this->_septic( 0, 1, undef, 1, <<EXPECT); 
     617sub test_no_header_with_footer_no_separator_with_results { 
     618    my $this = shift; 
     619    $this->_septic( 0, 1, undef, 1, <<'EXPECT'); 
    393620OkATopic 
    394621OkBTopic 
     
    396623FOOT 
    397624EXPECT 
    398 } 
    399  
    400 sub verify_no_header_with_footer_no_separator_no_results { 
    401     my $this = shift; 
    402     $this->_septic( 0, 1, undef, 0, <<EXPECT); 
     625 
     626    return; 
     627} 
     628 
     629sub test_no_header_with_footer_no_separator_no_results { 
     630    my $this = shift; 
     631    $this->_septic( 0, 1, undef, 0, <<'EXPECT'); 
    403632EXPECT 
    404 } 
    405  
    406 sub verify_no_header_with_footer_empty_separator_with_results { 
    407     my $this = shift; 
    408     $this->_septic( 0, 1, "", 1, <<EXPECT); 
     633 
     634    return; 
     635} 
     636 
     637sub test_no_header_with_footer_empty_separator_with_results { 
     638    my $this = shift; 
     639    $this->_septic( 0, 1, "", 1, <<'EXPECT'); 
    409640OkATopicOkBTopicOkTopicFOOT 
    410641EXPECT 
    411 } 
    412  
    413 sub verify_no_header_with_footer_empty_separator_no_results { 
    414     my $this = shift; 
    415     $this->_septic( 0, 1, "", 0, <<EXPECT); 
     642 
     643    return; 
     644} 
     645 
     646sub test_no_header_with_footer_empty_separator_no_results { 
     647    my $this = shift; 
     648    $this->_septic( 0, 1, "", 0, <<'EXPECT'); 
    416649EXPECT 
    417 } 
    418  
    419 sub verify_no_header_with_footer_with_separator_with_results { 
    420     my $this = shift; 
    421     $this->_septic( 0, 1, ",", 1, <<EXPECT); 
     650 
     651    return; 
     652} 
     653 
     654sub test_no_header_with_footer_with_separator_with_results { 
     655    my $this = shift; 
     656    $this->_septic( 0, 1, ",", 1, <<'EXPECT'); 
    422657OkATopic,OkBTopic,OkTopicFOOT 
    423658EXPECT 
     659 
     660    return; 
    424661} 
    425662 
    426663##################### 
    427664 
    428 sub verify_with_header_with_footer_no_separator_with_results { 
    429     my $this = shift; 
    430     $this->_septic( 1, 1, undef, 1, <<EXPECT); 
     665sub test_with_header_with_footer_no_separator_with_results { 
     666    my $this = shift; 
     667    $this->_septic( 1, 1, undef, 1, <<'EXPECT'); 
    431668HEAD 
    432669OkATopic 
     
    435672FOOT 
    436673EXPECT 
    437 } 
    438  
    439 sub verify_with_header_with_footer_no_separator_no_results { 
    440     my $this = shift; 
    441     $this->_septic( 1, 1, undef, 0, <<EXPECT); 
     674 
     675    return; 
     676} 
     677 
     678sub test_with_header_with_footer_no_separator_no_results { 
     679    my $this = shift; 
     680    $this->_septic( 1, 1, undef, 0, <<'EXPECT'); 
    442681EXPECT 
    443 } 
    444  
    445 sub verify_with_header_with_footer_empty_separator_with_results { 
    446     my $this = shift; 
    447     $this->_septic( 1, 1, "", 1, <<EXPECT); 
     682 
     683    return; 
     684} 
     685 
     686sub test_with_header_with_footer_empty_separator_with_results { 
     687    my $this = shift; 
     688    $this->_septic( 1, 1, "", 1, <<'EXPECT'); 
    448689HEADOkATopicOkBTopicOkTopicFOOT 
    449690EXPECT 
    450 } 
    451  
    452 sub verify_with_header_with_footer_empty_separator_no_results { 
    453     my $this = shift; 
    454     $this->_septic( 1, 1, "", 0, <<EXPECT); 
     691 
     692    return; 
     693} 
     694 
     695sub test_with_header_with_footer_empty_separator_no_results { 
     696    my $this = shift; 
     697    $this->_septic( 1, 1, "", 0, <<'EXPECT'); 
    455698EXPECT 
    456 } 
    457  
    458 sub verify_with_header_with_footer_with_separator_with_results { 
    459     my $this = shift; 
    460     $this->_septic( 1, 1, ",", 1, <<EXPECT); 
     699 
     700    return; 
     701} 
     702 
     703sub test_with_header_with_footer_with_separator_with_results { 
     704    my $this = shift; 
     705    $this->_septic( 1, 1, ",", 1, <<'EXPECT'); 
    461706HEADOkATopic,OkBTopic,OkTopicFOOT 
    462707EXPECT 
    463 } 
    464  
    465 sub verify_with_header_with_footer_with_separator_no_results { 
    466     my $this = shift; 
    467     $this->_septic( 1, 1, ",", 0, <<EXPECT); 
     708 
     709    return; 
     710} 
     711 
     712sub test_with_header_with_footer_with_separator_no_results { 
     713    my $this = shift; 
     714    $this->_septic( 1, 1, ",", 0, <<'EXPECT'); 
    468715EXPECT 
     716 
     717    return; 
    469718} 
    470719 
    471720##################### 
    472721 
    473 sub verify_with_header_no_footer_no_separator_with_results { 
    474     my $this = shift; 
    475     $this->_septic( 1, 0, undef, 1, <<EXPECT); 
     722sub test_with_header_no_footer_no_separator_with_results { 
     723    my $this = shift; 
     724    $this->_septic( 1, 0, undef, 1, <<'EXPECT'); 
    476725HEAD 
    477726OkATopic 
     
    479728OkTopic 
    480729EXPECT 
    481 } 
    482  
    483 sub verify_with_header_no_footer_no_separator_no_results { 
    484     my $this = shift; 
    485     $this->_septic( 1, 0, undef, 0, <<EXPECT); 
     730 
     731    return; 
     732} 
     733 
     734sub test_with_header_no_footer_no_separator_no_results { 
     735    my $this = shift; 
     736    $this->_septic( 1, 0, undef, 0, <<'EXPECT'); 
    486737EXPECT 
    487 } 
    488  
    489 sub verify_with_header_no_footer_empty_separator_with_results { 
    490     my $this = shift; 
    491     $this->_septic( 1, 0, "", 1, <<EXPECT); 
     738 
     739    return; 
     740} 
     741 
     742sub test_with_header_no_footer_empty_separator_with_results { 
     743    my $this = shift; 
     744    $this->_septic( 1, 0, "", 1, <<'EXPECT'); 
    492745HEADOkATopicOkBTopicOkTopic 
    493746EXPECT 
    494 } 
    495  
    496 sub verify_with_header_no_footer_empty_separator_no_results { 
    497     my $this = shift; 
    498     $this->_septic( 1, 0, "", 0, <<EXPECT); 
     747 
     748    return; 
     749} 
     750 
     751sub test_with_header_no_footer_empty_separator_no_results { 
     752    my $this = shift; 
     753    $this->_septic( 1, 0, "", 0, <<'EXPECT'); 
    499754EXPECT 
    500 } 
    501  
    502 sub verify_with_header_no_footer_with_separator_with_results { 
    503     my $this = shift; 
    504     $this->_septic( 1, 0, ",", 1, <<EXPECT); 
     755 
     756    return; 
     757} 
     758 
     759sub test_with_header_no_footer_with_separator_with_results { 
     760    my $this = shift; 
     761    $this->_septic( 1, 0, ",", 1, <<'EXPECT'); 
    505762HEADOkATopic,OkBTopic,OkTopic 
    506763EXPECT 
    507 } 
    508  
    509 sub verify_with_header_no_footer_with_separator_no_results { 
    510     my $this = shift; 
    511     $this->_septic( 1, 0, ",", 0, <<EXPECT); 
     764 
     765    return; 
     766} 
     767 
     768sub test_with_header_no_footer_with_separator_no_results { 
     769    my $this = shift; 
     770    $this->_septic( 1, 0, ",", 0, <<'EXPECT'); 
    512771EXPECT 
    513 } 
    514  
    515 sub verify_no_header_no_footer_with_nl_separator { 
    516     my $this = shift; 
    517     $this->_septic( 0, 0, '$n', 1, <<EXPECT); 
     772 
     773    return; 
     774} 
     775 
     776sub test_no_header_no_footer_with_nl_separator { 
     777    my $this = shift; 
     778    $this->_septic( 0, 0, '$n', 1, <<'EXPECT'); 
    518779OkATopic 
    519780OkBTopic 
    520781OkTopic 
    521782EXPECT 
    522 } 
    523  
    524 ##################### 
    525  
    526 sub verify_footer_with_ntopics { 
    527     my $this = shift; 
    528  
    529     my $result = 
    530       $this->{test_topicObject}->expandMacros( 
    531 '%SEARCH{"name~\'*Topic\'" type="query"  nonoise="on" footer="Total found: $ntopics" format="$topic"}%' 
    532       ); 
    533  
    534     $this->assert_str_equals( 
    535         join( "\n", sort qw(OkATopic OkBTopic OkTopic) ) . "\nTotal found: 3", 
    536         $result ); 
    537 } 
    538  
    539 sub verify_multiple_and_footer_with_ntopics_and_nhits { 
    540     my $this = shift; 
    541  
    542     $this->set_up_for_formatted_search(); 
    543  
    544     my $result = 
    545       $this->{test_topicObject}->expandMacros( 
    546 '%SEARCH{"Bullet" type="regex" multiple="on" nonoise="on" footer="Total found: $ntopics, Hits: $nhits" format="$text - $nhits"}%' 
    547       ); 
    548  
    549     $this->assert_str_equals( 
    550 "   * Bullet 1 - 1\n   * Bullet 2 - 2\n   * Bullet 3 - 3\n   * Bullet 4 - 4\nTotal found: 1, Hits: 4", 
    551         $result 
    552     ); 
    553 } 
    554  
    555 sub verify_footer_with_ntopics_empty_format { 
    556     my $this = shift; 
    557  
    558     my $result = 
    559       $this->{test_topicObject}->expandMacros( 
    560 '%SEARCH{"name~\'*Topic\'" type="query"  nonoise="on" footer="Total found: $ntopics" format="" separator=""}%' 
    561       ); 
    562  
    563     $this->assert_str_equals( "Total found: 3", $result ); 
    564 } 
    565  
    566 sub verify_nofinalnewline { 
    567     my $this = shift; 
    568  
    569     # nofinalnewline="off" 
    570     my $result = 
    571       $this->{test_topicObject}->expandMacros( 
    572 '%SEARCH{"name~\'OkTopic\'" type="query"  nonoise="on" format="$topic" nofinalnewline="off"}%' 
    573       ); 
    574  
    575     $this->assert_str_equals( "OkTopic\n", $result ); 
    576  
    577     # nofinalnewline="on" 
    578     $result = 
    579       $this->{test_topicObject}->expandMacros( 
    580 '%SEARCH{"name~\'OkTopic\'" type="query"  nonoise="on" format="$topic" nofinalnewline="on"}%' 
    581       ); 
    582  
    583     $this->assert_str_equals( "OkTopic", $result ); 
    584  
    585     # nofinalnewline should default be on 
    586     $result = 
    587       $this->{test_topicObject}->expandMacros( 
    588 '%SEARCH{"name~\'OkTopic\'" type="query"  nonoise="on" format="$topic"}%' 
    589       ); 
    590  
    591     $this->assert_str_equals( "OkTopic", $result ); 
    592  
     783 
     784    return; 
    593785} 
    594786 
     
    604796    $this->assert_matches( qr/OkBTopic/, $result ); 
    605797    $this->assert_matches( qr/OkATopic/, $result ); 
     798 
     799    return; 
    606800} 
    607801 
     
    619813    $this->assert_matches( qr/OkBTopic/, $result ); 
    620814    $this->assert_matches( qr/OkATopic/, $result ); 
     815 
     816    return; 
    621817} 
    622818 
     
    634830    $this->assert_matches( qr/OkBTopic/, $result ); 
    635831    $this->assert_matches( qr/OkATopic/, $result ); 
     832 
     833    return; 
    636834} 
    637835 
     
    649847    $this->assert_does_not_match( qr/OkBTopic/, $result ); 
    650848    $this->assert_does_not_match( qr/OkATopic/, $result ); 
     849 
     850    return; 
    651851} 
    652852 
     
    666866    $this->assert_matches( qr/OkBTopic/, $result ); 
    667867    $this->assert_matches( qr/OkATopic/, $result ); 
     868 
     869    return; 
    668870} 
    669871 
     
    681883    $this->assert_matches( qr/OkBTopic/, $result ); 
    682884    $this->assert_matches( qr/OkATopic/, $result ); 
     885 
     886    return; 
    683887} 
    684888 
     
    697901    $this->assert_matches( qr/OkATopic/, $result ); 
    698902 
     903    return; 
    699904} 
    700905 
     
    713918    $this->assert_does_not_match( qr/OkATopic/, $result ); 
    714919 
     920    return; 
    715921} 
    716922 
     
    730936    $this->assert_does_not_match( qr/OkBTopic/, $result ); 
    731937    $this->assert_does_not_match( qr/OkATopic/, $result ); 
     938 
     939    return; 
    732940} 
    733941 
     
    746954    $this->assert_does_not_match( qr/OkATopic/, $result ); 
    747955 
     956    return; 
    748957} 
    749958 
     
    762971    $this->assert_does_not_match( qr/OkATopic/, $result ); 
    763972 
     973    return; 
    764974} 
    765975 
     
    778988    $this->assert_does_not_match( qr/OkATopic/, $result ); 
    779989 
     990    return; 
    780991} 
    781992 
     
    7961007    $this->assert_does_not_match( qr/OkATopic/, $result ); 
    7971008 
     1009    return; 
    7981010} 
    7991011 
     
    8121024    $this->assert_does_not_match( qr/OkATopic/, $result ); 
    8131025 
     1026    return; 
    8141027} 
    8151028 
     
    8281041    $this->assert_does_not_match( qr/OkATopic/, $result ); 
    8291042 
     1043    return; 
    8301044} 
    8311045 
     
    8441058    $this->assert_does_not_match( qr/OkATopic/, $result ); 
    8451059 
     1060    return; 
    8461061} 
    8471062 
     
    8621077    $this->assert_does_not_match( qr/OkBTopic/, $result ); 
    8631078 
     1079    return; 
    8641080} 
    8651081 
     
    8781094    $this->assert_does_not_match( qr/OkBTopic/, $result ); 
    8791095 
     1096    return; 
    8801097} 
    8811098 
     
    8941111    $this->assert_matches( qr/OkATopic/, $result ); 
    8951112 
     1113    return; 
    8961114} 
    8971115 
     
    9071125    $this->assert_does_not_match( qr/OkATopic/, $result ); 
    9081126    $this->assert_matches( qr/OkBTopic/, $result ); 
     1127 
     1128    return; 
    9091129} 
    9101130 
     
    9221142HERE 
    9231143    $this->assert_str_equals( "$wn $this->{users_web}.$wn\n", $result ); 
     1144 
     1145    return; 
    9241146} 
    9251147 
     
    9311153        '%SEARCH{"" type="regex" scope="text" nonoise="on" format="$topic"}%'); 
    9321154    $this->assert_str_equals( "", $result ); 
     1155 
     1156    return; 
    9331157} 
    9341158 
     
    9411165      ); 
    9421166    $this->assert_str_equals( "", $result ); 
     1167 
     1168    return; 
    9431169} 
    9441170 
     
    9511177      ); 
    9521178    $this->assert_str_equals( "", $result ); 
     1179 
     1180    return; 
    9531181} 
    9541182 
     
    9601188        '%SEARCH{"" type="word" scope="text" nonoise="on" format="$topic"}%'); 
    9611189    $this->assert_str_equals( "", $result ); 
     1190 
     1191    return; 
    9621192} 
    9631193 
     
    9701200      ); 
    9711201    $this->assert_str_equals( "", $result ); 
     1202 
     1203    return; 
    9721204} 
    9731205 
     
    9801212      ); 
    9811213    $this->assert_str_equals( "", $result ); 
     1214 
     1215    return; 
    9821216} 
    9831217 
     
    9901224      ); 
    9911225    $this->assert_str_equals( "", $result ); 
     1226 
     1227    return; 
    9921228} 
    9931229 
     
    10001236      ); 
    10011237    $this->assert_str_equals( "", $result ); 
     1238 
     1239    return; 
    10021240} 
    10031241 
     
    10211259HERE 
    10221260 
    1023     my $topicObject = 
    1024       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 
    1025         'FormattedSearchTopic1', $text ); 
     1261    my ($topicObject) = 
     1262      Foswiki::Func::readTopic( $this->{test_web}, 'FormattedSearchTopic1' ); 
     1263    $topicObject->text($text); 
    10261264    $topicObject->save(); 
    1027 } 
    1028  
    1029 sub verify_formatted_search_summary_with_exclamation_marks { 
     1265    $topicObject->finish(); 
     1266 
     1267    return; 
     1268} 
     1269 
     1270sub test_footer_with_ntopics { 
     1271    my $this = shift; 
     1272 
     1273    my $result = 
     1274      $this->{test_topicObject}->expandMacros( 
     1275'%SEARCH{"name~\'*Topic\'" type="query"  nonoise="on" footer="Total found: $ntopics" format="$topic"}%' 
     1276      ); 
     1277 
     1278    $this->assert_str_equals( 
     1279        join( "\n", sort qw(OkATopic OkBTopic OkTopic) ) . "\nTotal found: 3", 
     1280        $result ); 
     1281 
     1282    return; 
     1283} 
     1284 
     1285sub test_multiple_and_footer_with_ntopics_and_nhits { 
     1286    my $this = shift; 
     1287 
     1288    $this->set_up_for_formatted_search(); 
     1289 
     1290    my $result = 
     1291      $this->{test_topicObject}->expandMacros( 
     1292'%SEARCH{"Bullet" type="regex" multiple="on" nonoise="on" footer="Total found: $ntopics, Hits: $nhits" format="$text - $nhits"}%' 
     1293      ); 
     1294 
     1295    $this->assert_str_equals( 
     1296"   * Bullet 1 - 1\n   * Bullet 2 - 2\n   * Bullet 3 - 3\n   * Bullet 4 - 4\nTotal found: 1, Hits: 4", 
     1297        $result 
     1298    ); 
     1299 
     1300    return; 
     1301} 
     1302 
     1303sub test_footer_with_ntopics_empty_format { 
     1304    my $this = shift; 
     1305 
     1306    my $result = 
     1307      $this->{test_topicObject}->expandMacros( 
     1308'%SEARCH{"name~\'*Topic\'" type="query"  nonoise="on" footer="Total found: $ntopics" format="" separator=""}%' 
     1309      ); 
     1310 
     1311    $this->assert_str_equals( "Total found: 3", $result ); 
     1312 
     1313    return; 
     1314} 
     1315 
     1316sub test_nofinalnewline { 
     1317    my $this = shift; 
     1318 
     1319    # nofinalnewline="off" 
     1320    my $result = 
     1321      $this->{test_topicObject}->expandMacros( 
     1322'%SEARCH{"name~\'OkTopic\'" type="query"  nonoise="on" format="$topic" nofinalnewline="off"}%' 
     1323      ); 
     1324 
     1325    $this->assert_str_equals( "OkTopic\n", $result ); 
     1326 
     1327    # nofinalnewline="on" 
     1328    $result = 
     1329      $this->{test_topicObject}->expandMacros( 
     1330'%SEARCH{"name~\'OkTopic\'" type="query"  nonoise="on" format="$topic" nofinalnewline="on"}%' 
     1331      ); 
     1332 
     1333    $this->assert_str_equals( "OkTopic", $result ); 
     1334 
     1335    # nofinalnewline should default be on 
     1336    $result = 
     1337      $this->{test_topicObject}->expandMacros( 
     1338'%SEARCH{"name~\'OkTopic\'" type="query"  nonoise="on" format="$topic"}%' 
     1339      ); 
     1340 
     1341    $this->assert_str_equals( "OkTopic", $result ); 
     1342 
     1343    return; 
     1344} 
     1345 
     1346sub test_formatted_search_summary_with_exclamation_marks { 
    10301347    my $this    = shift; 
    10311348    my $session = $this->{session}; 
     
    10501367    $expected = '<nop>AnnaAnchor'; 
    10511368    $this->assert_str_equals( $expected, $actual ); 
     1369 
     1370    return; 
    10521371} 
    10531372 
    10541373# Item8718 
    1055 sub verify_formatted_search_with_exclamation_marks_inside_bracket_link { 
     1374sub test_formatted_search_with_exclamation_marks_inside_bracket_link { 
    10561375    my $this    = shift; 
    10571376    my $session = $this->{session}; 
     
    10691388 
    10701389    $this->assert_str_equals( $expected, $actual ); 
     1390 
     1391    return; 
    10711392} 
    10721393 
     
    10851406        $result 
    10861407    ); 
     1408 
     1409    return; 
    10871410} 
    10881411 
     
    10991422    $this->assert_str_equals( "FormattedSearchTopic1 \$email \$html \$time", 
    11001423        $result ); 
    1101 } 
    1102  
    1103 sub verify_METASEARCH { 
     1424 
     1425    return; 
     1426} 
     1427 
     1428sub test_METASEARCH { 
    11041429    my $this    = shift; 
    11051430    my $session = $this->{session}; 
     
    11241449      $this->{test_topicObject}->renderTML('Children: FormattedSearchTopic1 '); 
    11251450    $this->assert_str_equals( $expected, $actual ); 
     1451 
     1452    return; 
    11261453} 
    11271454 
     
    11421469%META:FILEATTACHMENT{name="README" comment="Blah Blah" date="1157965062" size="5504"}% 
    11431470HERE 
    1144     my $topicObject = 
    1145       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'QueryTopic', 
    1146         $text ); 
     1471    my ($topicObject) = 
     1472      Foswiki::Func::readTopic( $this->{test_web}, 'QueryTopic' ); 
     1473    $topicObject->text($text); 
    11471474    $topicObject->save(); 
     1475    $topicObject->finish(); 
    11481476 
    11491477    $text = <<'HERE'; 
     
    11601488%META:FIELD{name="form" attributes="" title="Blah" value="form good"}% 
    11611489%META:FIELD{name="FORM" attributes="" title="Blah" value="FORM GOOD"}% 
    1162 %META:FIELD{name="NewField" attributes="" title="Item10269" value="TaxonProfile/Builder.TermForm"}% 
     1490%META:FIELD{name="NewField" attributes="" title="Item10269" value="Profile/Builder.TermForm"}% 
    11631491%META:FILEATTACHMENT{name="porn.gif" comment="Cor" date="15062" size="15504"}% 
    11641492%META:FILEATTACHMENT{name="flib.xml" comment="Cor" date="1157965062" size="1"}% 
    11651493HERE 
    1166     $topicObject = 
    1167       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'QueryTopicTwo', 
    1168         $text ); 
     1494    ($topicObject) = 
     1495      Foswiki::Func::readTopic( $this->{test_web}, 'QueryTopicTwo' ); 
     1496    $topicObject->text($text); 
    11691497    $topicObject->save(); 
    1170  
    1171     $this->{session}->finish(); 
    1172     my $query = new Unit::Request(""); 
     1498    $topicObject->finish(); 
     1499 
     1500    my $query = Unit::Request->new(''); 
    11731501    $query->path_info("/$this->{test_web}/$this->{test_topic}"); 
    11741502 
    1175     $this->{session} = new Foswiki( undef, $query ); 
     1503    $this->createNewFoswikiSession( undef, $query ); 
    11761504    $this->assert_str_equals( $this->{test_web}, $this->{session}->{webName} ); 
    1177     $Foswiki::Plugins::SESSION = $this->{session}; 
    1178  
    1179     $this->{test_topicObject} = 
    1180       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 
    1181         $this->{test_topic} ); 
     1505 
     1506    return; 
    11821507} 
    11831508 
     
    11951520      ->expandMacros( '%SEARCH{"parent.name=\'WebHome\'"' . $stdCrap ); 
    11961521    $this->assert_str_equals( 'QueryTopic', $result ); 
     1522 
     1523    return; 
    11971524} 
    11981525 
     
    12061533      ->expandMacros( '%SEARCH{"attachments[size > 0]"' . $stdCrap ); 
    12071534    $this->assert_str_equals( 'QueryTopic QueryTopicTwo', $result ); 
     1535 
     1536    return; 
    12081537} 
    12091538 
     
    12171546        '%SEARCH{"META:FILEATTACHMENT[size > 10000]"' . $stdCrap ); 
    12181547    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
     1548 
     1549    return; 
    12191550} 
    12201551 
     
    12281559      ->expandMacros( '%SEARCH{"attachments[name=\'flib.xml\']"' . $stdCrap ); 
    12291560    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
     1561 
     1562    return; 
    12301563} 
    12311564 
     
    12391572      ->expandMacros( '%SEARCH{"Lastname=\'Peel\'"' . $stdCrap ); 
    12401573    $this->assert_str_equals( 'QueryTopic QueryTopicTwo', $result ); 
     1574 
     1575    return; 
    12411576} 
    12421577 
     
    12501585        '%SEARCH{"text ~ \'*SMONG*\' AND Lastname=\'Peel\'"' . $stdCrap ); 
    12511586    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
     1587 
     1588    return; 
    12521589} 
    12531590 
     
    12611598        '%SEARCH{"text ~ \'*FURTLE*\' AND Lastname=\'Peel\'"' . $stdCrap ); 
    12621599    $this->assert_str_equals( 'QueryTopic', $result ); 
     1600 
     1601    return; 
    12631602} 
    12641603 
     
    12721611      ->expandMacros( '%SEARCH{"Lastname=\'Peel\'"' . $stdCrap ); 
    12731612    $this->assert_str_equals( 'QueryTopic QueryTopicTwo', $result ); 
     1613 
     1614    return; 
    12741615} 
    12751616 
     
    12831624      ->expandMacros( '%SEARCH{"form.name=\'TestyForm\'"' . $stdCrap ); 
    12841625    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
    1285 } 
    1286  
     1626 
     1627    return; 
     1628} 
     1629 
     1630#Item10520: in Sven's reading of System.QuerySearch, this should return no results, as there is no field of the name 'TestForm' 
    12871631sub verify_formQuery2 { 
    12881632    my $this = shift; 
     
    12931637      $this->{test_topicObject} 
    12941638      ->expandMacros( '%SEARCH{"TestForm"' . $stdCrap ); 
    1295     $this->assert_str_equals( 'QueryTopic', $result ); 
     1639    my $expected = 
     1640      $this->_expect_with_deps( '', 'Foswiki,<,1.2' => 'QueryTopic' ); 
     1641 
     1642    $this->assert_str_equals( $expected, $result ); 
     1643 
     1644    return; 
    12961645} 
    12971646 
     
    13051654        '%SEARCH{"TestForm[name=\'Field1\'].value=\'A Field\'"' . $stdCrap ); 
    13061655    $this->assert_str_equals( 'QueryTopic', $result ); 
     1656 
     1657    return; 
    13071658} 
    13081659 
     
    13281679      ->expandMacros( '%SEARCH{"TestForm.Field1=\'A Field\'"' . $stdCrap ); 
    13291680    $this->assert_str_equals( 'QueryTopic', $result ); 
     1681 
     1682    return; 
    13301683} 
    13311684 
     
    13551708      ->expandMacros( '%SEARCH{"TestyForm.FORM=\'FORM GOOD\'"' . $stdCrap ); 
    13561709    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
     1710 
     1711    return; 
    13571712} 
    13581713 
     
    13671722          . $stdCrap ); 
    13681723    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
     1724 
     1725    return; 
    13691726} 
    13701727 
     
    14121769 
    14131770    my $result = 
    1414       $this->{test_topicObject}->expandMacros( '%SEARCH{"A * B"' . $stdCrap ); 
    1415     $this->assert_matches( qr/Error was: Syntax error in 'A \* B' at ' \* B'/s, 
     1771      $this->{test_topicObject}->expandMacros( '%SEARCH{"A ¬ B"' . $stdCrap ); 
     1772    $this->assert_matches( qr/Error was: Syntax error in 'A ¬ B' at ' ¬ B'/s, 
    14161773        $result ); 
     1774 
     1775    return; 
    14171776} 
    14181777 
     
    14341793        my $vD = ( $n == 1 )   ? 'A' : 'B'; 
    14351794        my $vE = ( $n == 2 )   ? 'A' : 'B'; 
    1436         my $text = <<HERE; 
     1795        my $text = <<"HERE"; 
    14371796%META:TOPICINFO{author="TopicUserMapping_guest" date="12" format="1.1" version="1.2"}% 
    14381797---+ Progressive Sexuality 
     
    14611820%META:FIELD{name="FieldE" attributes="" title="Banother Field" value="$vE"}% 
    14621821HERE 
    1463         my $topicObject = 
    1464           Foswiki::Meta->new( $this->{session}, $this->{test_web}, 
    1465             "QueryTopic$n", $text ); 
     1822        my ($topicObject) = 
     1823          Foswiki::Func::readTopic( $this->{test_web}, "QueryTopic$n", ); 
     1824        $topicObject->text($text); 
    14661825        $topicObject->save(); 
     1826        $topicObject->finish(); 
    14671827    } 
    14681828    require Benchmark; 
    14691829 
    14701830    # Search using a regular expression 
    1471     my $start = new Benchmark; 
     1831    my $start = Benchmark->new(); 
    14721832 
    14731833    my $result = 
     
    14751835'%SEARCH{"^[%]META:FIELD{name=\"FieldA\".*\bvalue=\"A\";^[%]META:FIELD{name=\"FieldB\".*\bvalue=\"A\";^[%]META:FIELD{name=\"FieldC\".*\bvalue=\"A\";^[%]META:FIELD{name=\"FieldD\".*\bvalue=\"A\"|^[%]META:FIELD{name=\"FieldE\".*\bvalue=\"A\"" type="regex" nonoise="on" format="$topic" separator=" "}%' 
    14761836      ); 
    1477     my $retime = Benchmark::timediff( new Benchmark, $start ); 
     1837    my $retime = Benchmark::timediff( Benchmark->new(), $start ); 
    14781838    $this->assert_str_equals( 'QueryTopic1 QueryTopic2', $result ); 
    14791839 
    14801840    # Repeat using a query 
    1481     $start = new Benchmark; 
     1841    $start = Benchmark->new; 
    14821842    $result = 
    14831843      $this->{test_topicObject}->expandMacros( 
     
    14881848    print STDERR "Query " . Benchmark::timestr($querytime), 
    14891849      "\nRE " . Benchmark::timestr($retime), "\n"; 
    1490 } 
    1491  
    1492 sub verify_4347 { 
     1850 
     1851    return; 
     1852} 
     1853 
     1854sub test_4347 { 
    14931855    my $this = shift; 
    14941856 
     
    14981860      ); 
    14991861    $this->assert_str_equals( '', $result ); 
     1862 
     1863    return; 
    15001864} 
    15011865 
     
    15151879    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
    15161880 
    1517     my $topicObject = 
    1518       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 
    1519         'QueryTopicTwo' ); 
     1881    my ($topicObject) = 
     1882      Foswiki::Func::readTopic( $this->{test_web}, 'QueryTopicTwo' ); 
    15201883    $result = 
    15211884      $topicObject->expandMacros( '%SEARCH{"text ~ \'*SMONG*\'" ' . $stdCrap ); 
    15221885    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
    15231886 
    1524     $topicObject = 
    1525       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 
    1526         'QueryTopicTwo' ); 
     1887    $topicObject->finish(); 
     1888    ($topicObject) = 
     1889      Foswiki::Func::readTopic( $this->{test_web}, 'QueryTopicTwo' ); 
    15271890    $result = $topicObject->expandMacros( 
    15281891        '%SEARCH{"text ~ \'*QueryTopicTwo*\'" ' . $stdCrap ); 
    15291892    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
    1530  
     1893    $topicObject->finish(); 
     1894 
     1895    return; 
    15311896} 
    15321897 
     
    16121977    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
    16131978 
    1614     my $topicObject = 
    1615       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 
    1616         'QueryTopicTwo' ); 
     1979    my ($topicObject) = 
     1980      Foswiki::Func::readTopic( $this->{test_web}, 'QueryTopicTwo' ); 
    16171981    $result = 
    16181982      $topicObject->expandMacros( '%SEARCH{"text ~ \'*SMONG*\'" web="' 
     
    16211985    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
    16221986 
    1623     $topicObject = 
    1624       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 
    1625         'QueryTopicTwo' ); 
     1987    $topicObject->finish(); 
     1988    ($topicObject) = 
     1989      Foswiki::Func::readTopic( $this->{test_web}, 'QueryTopicTwo' ); 
    16261990    $result = 
    16271991      $topicObject->expandMacros( '%SEARCH{"text ~ \'*QueryTopicTwo*\'" web="' 
     
    16301994    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
    16311995 
    1632     $topicObject = 
    1633       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 
    1634         'QueryTopicTwo' ); 
     1996    $topicObject->finish(); 
     1997    ($topicObject) = 
     1998      Foswiki::Func::readTopic( $this->{test_web}, 'QueryTopicTwo' ); 
    16351999    $result = 
    16362000      $topicObject->expandMacros( '%SEARCH{"text ~ \'*Notinthetopics*\'" web="' 
     
    16382002          . $stdCrap ); 
    16392003    $this->assert_str_equals( '', $result ); 
     2004    $topicObject->finish(); 
    16402005 
    16412006    $result = 
     
    16452010          . $stdCrap ); 
    16462011    $this->assert_str_equals( 'QueryTopic', $result ); 
    1647 } 
    1648  
    1649 sub verify_pattern { 
     2012 
     2013    return; 
     2014} 
     2015 
     2016sub test_pattern { 
    16502017    my $this = shift; 
    16512018 
     
    16572024    $this->assert_matches( qr/Xdont.matchmeY/,  $result ); 
    16582025    $this->assert_matches( qr/XY/,              $result ); 
    1659 } 
    1660  
    1661 sub verify_badpattern { 
     2026 
     2027    return; 
     2028} 
     2029 
     2030sub test_badpattern { 
    16622031    my $this = shift; 
    16632032 
     
    16772046    # and format should be XY for all 3 topics 
    16782047    $this->assert_equals( 3, $result =~ s/^XY$//gm ); 
    1679 } 
    1680  
    1681 sub verify_validatepattern { 
     2048 
     2049    return; 
     2050} 
     2051 
     2052sub test_validatepattern { 
    16822053    my $this = shift; 
    16832054    my ( $pattern, $temp ); 
     
    17132084    $this->assert_matches( qr/$pattern/, 'foobluebar' ); 
    17142085 
     2086    return; 
    17152087} 
    17162088 
    17172089#Item977 
    1718 sub verify_formatOfLinks { 
    1719     my $this = shift; 
    1720  
    1721     my $topicObject = Foswiki::Meta->new( 
    1722         $this->{session}, 
    1723         $this->{test_web}, 'Item977', "---+ Apache 
     2090sub test_formatOfLinks { 
     2091    my $this = shift; 
     2092 
     2093    my ($topicObject) = 
     2094      Foswiki::Func::readTopic( $this->{test_web}, 'Item977' ); 
     2095    $topicObject->text(<<'HERE'); 
     2096---+ Apache 
    17242097 
    17252098Apache is the [[http://www.apache.org/httpd/][well known web server]]. 
    1726 " 
    1727     ); 
     2099HERE 
    17282100    $topicObject->save(); 
     2101    $topicObject->finish(); 
    17292102 
    17302103    my $result = 
     
    17652138          ->TML2PlainText('Apache is the well known web server.') ); 
    17662139 
     2140    return; 
    17672141} 
    17682142 
    17692143sub _getTopicList { 
    1770     my $this    = shift; 
    1771     my $web     = shift; 
    1772     my $options = shift; 
     2144    my ( $this, $web, $options, $sadness, $default_expected, %expected_list ) = 
     2145      @_; 
     2146    my $expected = 
     2147      $this->_expect_with_deps( $default_expected, %expected_list ); 
    17732148 
    17742149    #    my $options = { 
     
    17792154    #    }; 
    17802155 
     2156    $this->assert_str_equals( 'ARRAY', ref($expected) ); 
    17812157    my $webObject = Foswiki::Meta->new( $this->{session}, $web ); 
    17822158 
     
    17862162      Foswiki::Search::InfoCache::getTopicListIterator( $webObject, $options ); 
    17872163 
    1788     ASSERT( UNIVERSAL::isa( $iter, 'Foswiki::Iterator' ) ) if DEBUG; 
     2164    ASSERT( $iter->isa('Foswiki::Iterator') ) if DEBUG; 
    17892165    my @topicList = (); 
    17902166    while ( my $t = $iter->next() ) { 
     2167        next if ( $t eq 'InvisibleTopic' );    #and user != admin or... 
    17912168        push( @topicList, $t ); 
    17922169    } 
    1793  
     2170    $webObject->finish(); 
     2171 
     2172    my $l1 = join( ',', @{$expected} ); 
     2173    my $l2 = join( ',', @topicList ); 
     2174    $this->assert_str_equals( $l1, $l2, "$sadness:\nwant: $l2\n got: $l1" ); 
    17942175    return \@topicList; 
    17952176} 
     
    17992180 
    18002181    #no topics specified.. 
    1801     $this->assert_deep_equals( 
     2182    $this->_getTopicList( 
     2183        $this->{test_web}, 
     2184        {}, 
     2185        'no filters, all topics in test_web', 
    18022186        [ 
    18032187            'OkATopic', 'OkBTopic', 
     
    18052189            'WebPreferences' 
    18062190        ], 
    1807         $this->_getTopicList( $this->{test_web}, {} ), 
    1808         'no filters, all topics in test_web' 
    1809     ); 
    1810     $this->assert_deep_equals( 
     2191    ); 
     2192    $this->_getTopicList( 
     2193        '_default', 
     2194        {}, 
     2195        'no filters, all topics in test_web', 
    18112196        [ 
    18122197            'WebAtom',           'WebChanges', 
     
    18172202            'WebSearchAdvanced', 'WebTopicList' 
    18182203        ], 
    1819         $this->_getTopicList( '_default', {} ), 
    1820         'no filters, all topics in _default web' 
    18212204    ); 
    18222205 
    18232206    #use wildcards 
    1824     $this->assert_deep_equals( 
     2207    $this->_getTopicList( 
     2208        $this->{test_web}, 
     2209        { includeTopics => 'Ok*' }, 
     2210        'comma separated list', 
    18252211        [ 'OkATopic', 'OkBTopic', 'OkTopic' ], 
    1826         $this->_getTopicList( $this->{test_web}, { includeTopics => 'Ok*' } ), 
    1827         'test_web, Wildcard includeTopics Ok*' 
    1828     ); 
    1829     $this->assert_deep_equals( 
     2212    ); 
     2213    $this->_getTopicList( 
     2214        '_default', 
     2215        { includeTopics => 'Web*' }, 
     2216        'no filters, all topics in test_web', 
    18302217        [ 
    18312218            'WebAtom',           'WebChanges', 
     
    18362223            'WebSearchAdvanced', 'WebTopicList' 
    18372224        ], 
    1838         $this->_getTopicList( '_default', { includeTopics => 'Web*' } ), 
    1839         '_default web, Wildcard includeTopics Web*' 
    18402225    ); 
    18412226 
    18422227    #comma separated list specifed for inclusion 
    1843     $this->assert_deep_equals( 
    1844         [ 'TestTopicSEARCH', 'OkTopic' ], 
    1845         $this->_getTopicList( 
    1846             $this->{test_web}, 
    1847             { includeTopics => 'TestTopicSEARCH,OkTopic,NoSuchTopic' } 
    1848         ), 
    1849         'test_web, comma separated includeTopics, missing topic' 
    1850     ); 
    1851     $this->assert_deep_equals( 
    1852         [ 'WebTopicList', 'WebCreateNewTopic' ], 
    1853         $this->_getTopicList( 
    1854             '_default', 
    1855             { includeTopics => 'WebTopicList, WebCreateNewTopic, NoSuchTopic' } 
    1856         ), 
    1857         '_default web, comma-space separated includeTopics, missing topic ' 
     2228    $this->_getTopicList( 
     2229        $this->{test_web}, 
     2230        { includeTopics => 'TestTopicSEARCH,OkTopic,NoSuchTopic' }, 
     2231        'comma separated list', 
     2232        [ 'OkTopic', 'TestTopicSEARCH' ], 
     2233        'Foswiki,<,1.2' => [ 'TestTopicSEARCH', 'OkTopic' ], 
     2234    ); 
     2235    $this->_getTopicList( 
     2236        '_default', 
     2237        { includeTopics => 'WebTopicList, WebCreateNewTopic, NoSuchTopic' }, 
     2238        'no filters, all topics in test_web', 
     2239        [ 'WebCreateNewTopic', 'WebTopicList' ], 
     2240        'Foswiki,<,1.2' => [ 'WebTopicList', 'WebCreateNewTopic' ], 
    18582241    ); 
    18592242 
    18602243    #excludes 
    1861     $this->assert_deep_equals( 
     2244    $this->_getTopicList( 
     2245        $this->{test_web}, 
     2246        { excludeTopics => 'NoSuchTopic,OkBTopic' }, 
     2247        'no filters, all topics in test_web', 
    18622248        [ 'OkATopic', 'OkTopic', 'TestTopicSEARCH', 'WebPreferences' ], 
    1863         $this->_getTopicList( 
    1864             $this->{test_web}, { excludeTopics => 'NoSuchTopic,OkBTopic' } 
    1865         ), 
    1866         'test_web, comma separated excludeTopics list' 
    1867     ); 
    1868     $this->assert_deep_equals( 
     2249    ); 
     2250    $this->_getTopicList( 
     2251        '_default', 
     2252        { excludeTopics => 'WebSearch' }, 
     2253        'no filters, all topics in test_web', 
    18692254        [ 
    18702255            'WebAtom',           'WebChanges', 
     
    18752260            'WebTopicList' 
    18762261        ], 
    1877         $this->_getTopicList( '_default', { excludeTopics => 'WebSearch' } ), 
    1878         '_default web, exclude WebSearch' 
    18792262    ); 
    18802263 
    18812264    #Talk about missing alot of tests 
    1882     $this->assert_deep_equals( 
     2265    $this->_getTopicList( 
     2266        $this->{test_web}, 
     2267        { includeTopics => '*' }, 
     2268        'all topics, using wildcard', 
    18832269        [ 
    18842270            'OkATopic', 'OkBTopic', 
     
    18862272            'WebPreferences' 
    18872273        ], 
    1888         $this->_getTopicList( $this->{test_web}, { includeTopics => '*' } ), 
    1889         'all topics, using wildcard' 
    1890     ); 
    1891     $this->assert_deep_equals( 
     2274    ); 
     2275    $this->_getTopicList( 
     2276        $this->{test_web}, 
     2277        { includeTopics => 'Ok*' }, 
     2278        'Ok* topics, using wildcard', 
    18922279        [ 'OkATopic', 'OkBTopic', 'OkTopic' ], 
    1893         $this->_getTopicList( $this->{test_web}, { includeTopics => 'Ok*' } ), 
    1894         'Ok* topics, using wildcard' 
    1895     ); 
    1896     $this->assert_deep_equals( 
     2280    ); 
     2281    $this->_getTopicList( 
     2282        $this->{test_web}, 
     2283        { 
     2284            includeTopics => 'ok*', 
     2285            casesensitive => 1 
     2286        }, 
     2287        'case sensitive ok* topics, using wildcard', 
    18972288        [], 
    1898         $this->_getTopicList( 
    1899             $this->{test_web}, 
    1900             { 
    1901                 includeTopics => 'ok*', 
    1902                 casesensitive => 1 
    1903             } 
    1904         ), 
    1905         'case sensitive ok* topics, using wildcard' 
    1906     ); 
    1907     $this->assert_deep_equals( 
     2289    ); 
     2290    $this->_getTopicList( 
     2291        $this->{test_web}, 
     2292        { 
     2293            includeTopics => 'ok*', 
     2294            casesensitive => 0 
     2295        }, 
     2296        'case insensitive ok* topics, using wildcard', 
    19082297        [ 'OkATopic', 'OkBTopic', 'OkTopic' ], 
    1909         $this->_getTopicList( 
    1910             $this->{test_web}, 
    1911             { 
    1912                 includeTopics => 'ok*', 
    1913                 casesensitive => 0 
    1914             } 
    1915         ), 
    1916         'case insensitive ok* topics, using wildcard' 
    19172298    ); 
    19182299 
     
    19232304 
    19242305        # this test won't work on Mac OS X or windows. 
    1925         $this->assert_deep_equals( 
    1926             [], 
    1927             $this->_getTopicList( 
    1928                 $this->{test_web}, 
    1929                 { 
    1930                     includeTopics => 'okatopic', 
    1931                     casesensitive => 1 
    1932                 } 
    1933             ), 
    1934             'case sensitive okatopic topic 1' 
    1935         ); 
    1936     } 
    1937  
    1938     $this->assert_deep_equals( 
    1939         ['OkATopic'], 
    19402306        $this->_getTopicList( 
    19412307            $this->{test_web}, 
    19422308            { 
    19432309                includeTopics => 'okatopic', 
    1944                 casesensitive => 0 
    1945             } 
    1946         ), 
    1947         'case insensitive okatopic topic' 
     2310                casesensitive => 1 
     2311            }, 
     2312            'case sensitive okatopic topic 1', 
     2313            [], 
     2314        ); 
     2315    } 
     2316 
     2317    $this->_getTopicList( 
     2318        $this->{test_web}, 
     2319        { 
     2320            includeTopics => 'okatopic', 
     2321            casesensitive => 0 
     2322        }, 
     2323        'case insensitive okatopic topic', 
     2324        ['OkATopic'], 
    19482325    ); 
    19492326    ##### same again, with excludes. 
    1950     $this->assert_deep_equals( 
     2327    $this->_getTopicList( 
     2328        $this->{test_web}, 
     2329        { 
     2330            includeTopics => '*', 
     2331            excludeTopics => 'web*' 
     2332        }, 
     2333        'all topics, using wildcard', 
    19512334        [ 
    19522335            'OkATopic', 'OkBTopic', 
     
    19542337            'WebPreferences' 
    19552338        ], 
    1956         $this->_getTopicList( 
    1957             $this->{test_web}, 
    1958             { 
    1959                 includeTopics => '*', 
    1960                 excludeTopics => 'web*' 
    1961             } 
    1962         ), 
    1963         'all topics, using wildcard' 
    1964     ); 
    1965     $this->assert_deep_equals( 
     2339    ); 
     2340    $this->_getTopicList( 
     2341        $this->{test_web}, 
     2342        { 
     2343            includeTopics => 'Ok*', 
     2344            excludeTopics => 'okatopic' 
     2345        }, 
     2346        'Ok* topics, using wildcard', 
    19662347        [ 'OkATopic', 'OkBTopic', 'OkTopic' ], 
    1967         $this->_getTopicList( 
    1968             $this->{test_web}, 
    1969             { 
    1970                 includeTopics => 'Ok*', 
    1971                 excludeTopics => 'okatopic' 
    1972             } 
    1973         ), 
    1974         'Ok* topics, using wildcard' 
    1975     ); 
    1976     $this->assert_deep_equals( 
     2348    ); 
     2349    $this->_getTopicList( 
     2350        $this->{test_web}, 
     2351        { 
     2352            includeTopics => 'ok*', 
     2353            excludeTopics => 'WebPreferences', 
     2354            casesensitive => 1 
     2355        }, 
     2356        'case sensitive ok* topics, using wildcard', 
    19772357        [], 
    1978         $this->_getTopicList( 
    1979             $this->{test_web}, 
    1980             { 
    1981                 includeTopics => 'ok*', 
    1982                 excludeTopics => 'WebPreferences', 
    1983                 casesensitive => 1 
    1984             } 
    1985         ), 
    1986         'case sensitive ok* topics, using wildcard' 
    1987     ); 
    1988     $this->assert_deep_equals( 
     2358    ); 
     2359    $this->_getTopicList( 
     2360        $this->{test_web}, 
     2361        { 
     2362            includeTopics => 'ok*', 
     2363            excludeTopics => '', 
     2364            casesensitive => 0 
     2365        }, 
     2366        'case insensitive ok* topics, using wildcard', 
    19892367        [ 'OkATopic', 'OkBTopic', 'OkTopic' ], 
    1990         $this->_getTopicList( 
    1991             $this->{test_web}, 
    1992             { 
    1993                 includeTopics => 'ok*', 
    1994                 excludeTopics => '', 
    1995                 casesensitive => 0 
    1996             } 
    1997         ), 
    1998         'case insensitive ok* topics, using wildcard' 
    1999     ); 
    2000  
    2001     $this->assert_deep_equals( 
     2368    ); 
     2369 
     2370    $this->_getTopicList( 
     2371        $this->{test_web}, 
     2372        { 
     2373            includeTopics => 'Ok*', 
     2374            excludeTopics => '*ATopic', 
     2375            casesensitive => 1 
     2376        }, 
     2377        'case sensitive okatopic topic 2', 
    20022378        [ 'OkBTopic', 'OkTopic' ], 
    2003         $this->_getTopicList( 
    2004             $this->{test_web}, 
    2005             { 
    2006                 includeTopics => 'Ok*', 
    2007                 excludeTopics => '*ATopic', 
    2008                 casesensitive => 1 
    2009             } 
    2010         ), 
    2011         'case sensitive okatopic topic 2' 
    2012     ); 
    2013  
    2014     $this->assert_deep_equals( 
     2379    ); 
     2380 
     2381    $this->_getTopicList( 
     2382        $this->{test_web}, 
     2383        { 
     2384            includeTopics => 'Ok*', 
     2385            excludeTopics => '*atopic', 
     2386            casesensitive => 1 
     2387        }, 
     2388        'case sensitive okatopic topic 3', 
    20152389        [ 'OkATopic', 'OkBTopic', 'OkTopic' ], 
    2016         $this->_getTopicList( 
    2017             $this->{test_web}, 
    2018             { 
    2019                 includeTopics => 'Ok*', 
    2020                 excludeTopics => '*atopic', 
    2021                 casesensitive => 1 
    2022             } 
    2023         ), 
    2024         'case sensitive okatopic topic 3' 
    2025     ); 
    2026  
    2027     $this->assert_deep_equals( 
     2390    ); 
     2391 
     2392    $this->_getTopicList( 
     2393        $this->{test_web}, 
     2394        { 
     2395            includeTopics => 'ok*topic', 
     2396            excludeTopics => 'okatopic', 
     2397            casesensitive => 0 
     2398        }, 
     2399        'case insensitive okatopic topic', 
    20282400        [ 'OkBTopic', 'OkTopic' ], 
    2029         $this->_getTopicList( 
    2030             $this->{test_web}, 
    2031             { 
    2032                 includeTopics => 'ok*topic', 
    2033                 excludeTopics => 'okatopic', 
    2034                 casesensitive => 0 
    2035             } 
    2036         ), 
    2037         'case insensitive okatopic topic' 
    2038     ); 
    2039  
     2401    ); 
     2402 
     2403    return; 
    20402404} 
    20412405 
     
    21112475    $this->assert_str_equals( $expected, $actual ); 
    21122476 
     2477    return; 
    21132478} 
    21142479 
     
    21162481    my $this = shift; 
    21172482 
    2118     my $topicObject = 
    2119       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'TestForm', 
    2120         <<'FORM'); 
     2483    my ($topicObject) = 
     2484      Foswiki::Func::readTopic( $this->{test_web}, 'TestForm' ); 
     2485    $topicObject->text(<<'FORM'); 
    21212486| *Name*         | *Type* | *Size* | *Value*   | *Tooltip message* | *Attributes* | 
    21222487| Why | text | 32 | | Mandatory field | M | 
     
    21242489FORM 
    21252490    $topicObject->save(); 
    2126     $topicObject = 
    2127       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'SplodgeOne', 
    2128         <<FORM); 
     2491    $topicObject->finish(); 
     2492    ($topicObject) = 
     2493      Foswiki::Func::readTopic( $this->{test_web}, 'SplodgeOne' ); 
     2494    $topicObject->text( <<'FORM'); 
    21292495%META:FORM{name="TestForm"}% 
    21302496%META:FIELD{name="Ecks" attributes="" title="X" value="Blah"}% 
     
    21372503    my $expected = 'SplodgeOne;Blah'; 
    21382504    $this->assert_str_equals( $expected, $actual ); 
    2139  
     2505    $topicObject->finish(); 
     2506 
     2507    return; 
    21402508} 
    21412509 
     
    21432511    my $this = shift; 
    21442512 
    2145     my $topicObject = 
    2146       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'TestForm', 
    2147         <<'FORM'); 
     2513    my ($topicObject) = 
     2514      Foswiki::Func::readTopic( $this->{test_web}, 'TestForm' ); 
     2515    $topicObject->text( <<'FORM'); 
    21482516| *Name*         | *Type* | *Size* | *Value*   | *Tooltip message* | *Attributes* | 
    21492517| Why | text | 32 | | Mandatory field | M | 
     
    21512519FORM 
    21522520    $topicObject->save(); 
    2153     $topicObject = 
    2154       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'SplodgeOne', 
    2155         <<FORM); 
     2521    $topicObject->finish(); 
     2522    ($topicObject) = 
     2523      Foswiki::Func::readTopic( $this->{test_web}, 'SplodgeOne' ); 
     2524    $topicObject->text(<<'FORM'); 
    21562525%META:FORM{name="TestForm"}% 
    21572526%META:FIELD{name="Ecks" attributes="" title="X" value="Blah"}% 
     
    21642533    my $expected = 'SplodgeOne;Blah'; 
    21652534    $this->assert_str_equals( $expected, $actual ); 
    2166  
     2535    $topicObject->finish(); 
     2536 
     2537    return; 
    21672538} 
    21682539 
     
    21882559HERE 
    21892560    $this->assert_str_equals( $expected, $actual ); 
     2561 
     2562    return; 
    21902563} 
    21912564 
     
    21952568#need summary, and multiple 
    21962569sub _multiWebSeptic { 
    2197     my ( $this, $head, $foot, $sep, $results, $expected, $format ) = @_; 
     2570    my ( $this, $head, $foot, $sep, $results, $format, $default, %expectations ) 
     2571      = @_; 
    21982572    my $str = $results ? '*Preferences' : 'Septic'; 
    21992573    $head = $head        ? 'header="HEAD($web)"'            : ''; 
     
    22012575    $sep  = defined $sep ? "separator=\"$sep\""             : ''; 
    22022576    $format = '$topic' unless ( defined($format) ); 
     2577    my $expected = $this->_expect_with_deps( $default, %expectations ); 
    22032578 
    22042579    my $result = $this->{test_topicObject}->expandMacros( 
     
    22142589    $expected =~ s/\n$//s; 
    22152590    $this->assert_str_equals( $expected, $result ); 
     2591 
     2592    return; 
    22162593} 
    22172594 
    22182595##################### 
    22192596 
    2220 sub verify_multiWeb_no_header_no_footer_no_separator_with_results { 
    2221     my $this = shift; 
    2222     $this->_multiWebSeptic( 0, 0, undef, 1, <<EXPECT); 
     2597sub test_multiWeb_no_header_no_footer_no_separator_with_results { 
     2598    my $this = shift; 
     2599    $this->_multiWebSeptic( 
     2600        0, 0, undef, 1, undef, <<'FOSWIKI12', 
     2601SitePreferences 
     2602WebPreferences 
     2603DefaultPreferences 
     2604WebPreferences 
     2605FOSWIKI12 
     2606        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    22232607DefaultPreferences 
    22242608WebPreferences 
    22252609SitePreferences 
    22262610WebPreferences 
    2227 EXPECT 
    2228 } 
    2229  
    2230 sub verify_multiWeb_no_header_no_footer_no_separator_with_results_counters { 
    2231     my $this = shift; 
    2232     $this->_multiWebSeptic( 0, 0, undef, 1, 
    2233         <<EXPECT, '$nhits, $ntopics, $index, $topic' ); 
     2611FOSWIKI11 
     2612 
     2613    return; 
     2614} 
     2615 
     2616sub test_multiWeb_no_header_no_footer_no_separator_with_results_counters { 
     2617    my $this = shift; 
     2618    $this->_multiWebSeptic( 
     2619        0,                                  0, undef, 1, 
     2620        '$nhits, $ntopics, $index, $topic', <<'FOSWIKI12', 
     26211, 1, 1, SitePreferences 
     26222, 2, 2, WebPreferences 
     26231, 1, 3, DefaultPreferences 
     26242, 2, 4, WebPreferences 
     2625FOSWIKI12 
     2626        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    223426271, 1, 1, DefaultPreferences 
    223526282, 2, 2, WebPreferences 
    223626291, 1, 3, SitePreferences 
    223726302, 2, 4, WebPreferences 
    2238 EXPECT 
    2239 } 
    2240  
    2241 sub verify_multiWeb_no_header_no_footer_no_separator_no_results { 
    2242     my $this = shift; 
    2243     $this->_multiWebSeptic( 0, 0, undef, 0, <<EXPECT); 
    2244 EXPECT 
    2245 } 
    2246  
    2247 sub verify_multiWeb_no_header_no_footer_empty_separator_with_results { 
    2248     my $this = shift; 
    2249     $this->_multiWebSeptic( 0, 0, "", 1, <<EXPECT); 
     2631FOSWIKI11 
     2632 
     2633    return; 
     2634} 
     2635 
     2636sub test_multiWeb_no_header_no_footer_no_separator_no_results { 
     2637    my $this = shift; 
     2638    $this->_multiWebSeptic( 0, 0, undef, 0, undef, <<'FOSWIKI12'); 
     2639FOSWIKI12 
     2640 
     2641    return; 
     2642} 
     2643 
     2644sub test_multiWeb_no_header_no_footer_empty_separator_with_results { 
     2645    my $this = shift; 
     2646    $this->_multiWebSeptic( 
     2647        0, 0, "", 1, undef, <<'FOSWIKI12', 
     2648SitePreferencesWebPreferencesDefaultPreferencesWebPreferences 
     2649FOSWIKI12 
     2650        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    22502651DefaultPreferencesWebPreferencesSitePreferencesWebPreferences 
    2251 EXPECT 
    2252 } 
    2253  
    2254 sub verify_multiWeb_no_header_no_footer_empty_separator_no_results { 
    2255     my $this = shift; 
    2256     $this->_multiWebSeptic( 0, 0, "", 0, <<EXPECT); 
    2257 EXPECT 
    2258 } 
    2259  
    2260 sub verify_multiWeb_no_header_no_footer_with_separator_with_results { 
    2261     my $this = shift; 
    2262     $this->_multiWebSeptic( 0, 0, ",", 1, <<EXPECT); 
     2652FOSWIKI11 
     2653 
     2654    return; 
     2655} 
     2656 
     2657sub test_multiWeb_no_header_no_footer_empty_separator_no_results { 
     2658    my $this = shift; 
     2659    $this->_multiWebSeptic( 0, 0, "", 0, undef, <<'FOSWIKI12'); 
     2660FOSWIKI12 
     2661 
     2662    return; 
     2663} 
     2664 
     2665sub test_multiWeb_no_header_no_footer_with_separator_with_results { 
     2666    my $this = shift; 
     2667    $this->_multiWebSeptic( 
     2668        0, 0, ",", 1, undef, <<'FOSWIKI12', 
     2669SitePreferences,WebPreferences,DefaultPreferences,WebPreferences 
     2670FOSWIKI12 
     2671        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    22632672DefaultPreferences,WebPreferences,SitePreferences,WebPreferences 
    2264 EXPECT 
    2265 } 
    2266  
    2267 sub verify_multiWeb_no_header_no_footer_with_separator_no_results { 
    2268     my $this = shift; 
    2269     $this->_multiWebSeptic( 0, 0, ",", 0, <<EXPECT); 
    2270 EXPECT 
     2673FOSWIKI11 
     2674 
     2675    return; 
     2676} 
     2677 
     2678sub test_multiWeb_no_header_no_footer_with_separator_no_results { 
     2679    my $this = shift; 
     2680    $this->_multiWebSeptic( 0, 0, ",", 0, undef, <<'FOSWIKI12'); 
     2681FOSWIKI12 
     2682 
     2683    return; 
    22712684} 
    22722685##################### 
    22732686 
    2274 sub verify_multiWeb_no_header_with_footer_no_separator_with_results { 
    2275     my $this = shift; 
    2276     $this->_multiWebSeptic( 0, 1, undef, 1, <<EXPECT); 
     2687sub test_multiWeb_no_header_with_footer_no_separator_with_results { 
     2688    my $this = shift; 
     2689    $this->_multiWebSeptic( 
     2690        0, 1, undef, 1, undef, <<'FOSWIKI12', 
     2691SitePreferences 
     2692WebPreferences 
     2693FOOT(2,2)DefaultPreferences 
     2694WebPreferences 
     2695FOOT(2,2) 
     2696FOSWIKI12 
     2697        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    22772698DefaultPreferences 
    22782699WebPreferences 
     
    22802701WebPreferences 
    22812702FOOT(2,2) 
    2282 EXPECT 
    2283 } 
    2284  
    2285 sub verify_multiWeb_no_header_with_footer_no_separator_no_results { 
    2286     my $this = shift; 
    2287     $this->_multiWebSeptic( 0, 1, undef, 0, <<EXPECT); 
    2288 EXPECT 
    2289 } 
    2290  
    2291 sub verify_multiWeb_no_header_with_footer_empty_separator_with_results { 
    2292     my $this = shift; 
    2293     $this->_multiWebSeptic( 0, 1, "", 1, <<EXPECT); 
     2703FOSWIKI11 
     2704 
     2705    return; 
     2706} 
     2707 
     2708sub test_multiWeb_no_header_with_footer_no_separator_no_results { 
     2709    my $this = shift; 
     2710    $this->_multiWebSeptic( 0, 1, undef, 0, undef, <<'FOSWIKI12'); 
     2711FOSWIKI12 
     2712 
     2713    return; 
     2714} 
     2715 
     2716sub test_multiWeb_no_header_with_footer_empty_separator_with_results { 
     2717    my $this = shift; 
     2718    $this->_multiWebSeptic( 
     2719        0, 1, "", 1, undef, <<'FOSWIKI12', 
     2720SitePreferencesWebPreferencesFOOT(2,2)DefaultPreferencesWebPreferencesFOOT(2,2) 
     2721FOSWIKI12 
     2722        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    22942723DefaultPreferencesWebPreferencesFOOT(2,2)SitePreferencesWebPreferencesFOOT(2,2) 
    2295 EXPECT 
    2296 } 
    2297  
    2298 sub verify_multiWeb_no_header_with_footer_empty_separator_no_results { 
    2299     my $this = shift; 
    2300     $this->_multiWebSeptic( 0, 1, "", 0, <<EXPECT); 
    2301 EXPECT 
    2302 } 
    2303  
    2304 sub verify_multiWeb_no_header_with_footer_with_separator_with_results { 
    2305     my $this = shift; 
    2306     $this->_multiWebSeptic( 0, 1, ",", 1, <<EXPECT); 
     2724FOSWIKI11 
     2725 
     2726    return; 
     2727} 
     2728 
     2729sub test_multiWeb_no_header_with_footer_empty_separator_no_results { 
     2730    my $this = shift; 
     2731    $this->_multiWebSeptic( 0, 1, "", 0, undef, <<'FOSWIKI12'); 
     2732FOSWIKI12 
     2733 
     2734    return; 
     2735} 
     2736 
     2737sub test_multiWeb_no_header_with_footer_with_separator_with_results { 
     2738    my $this = shift; 
     2739    $this->_multiWebSeptic( 
     2740        0, 1, ",", 1, undef, <<'FOSWIKI12', 
     2741SitePreferences,WebPreferencesFOOT(2,2)DefaultPreferences,WebPreferencesFOOT(2,2) 
     2742FOSWIKI12 
     2743        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    23072744DefaultPreferences,WebPreferencesFOOT(2,2)SitePreferences,WebPreferencesFOOT(2,2) 
    2308 EXPECT 
     2745FOSWIKI11 
     2746 
     2747    return; 
    23092748} 
    23102749 
    23112750##################### 
    23122751 
    2313 sub verify_multiWeb_with_header_with_footer_no_separator_with_results { 
    2314     my $this = shift; 
    2315     $this->_multiWebSeptic( 1, 1, undef, 1, <<EXPECT); 
     2752sub test_multiWeb_with_header_with_footer_no_separator_with_results { 
     2753    my $this = shift; 
     2754    $this->_multiWebSeptic( 
     2755        1, 1, undef, 1, undef, <<'FOSWIKI12', 
     2756HEAD(Main) 
     2757SitePreferences 
     2758WebPreferences 
     2759FOOT(2,2)HEAD(System) 
     2760DefaultPreferences 
     2761WebPreferences 
     2762FOOT(2,2) 
     2763FOSWIKI12 
     2764        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    23162765HEAD(System) 
    23172766DefaultPreferences 
     
    23212770WebPreferences 
    23222771FOOT(2,2) 
    2323 EXPECT 
    2324 } 
    2325  
    2326 sub verify_multiWeb_with_header_with_footer_no_separator_no_results { 
    2327     my $this = shift; 
    2328     $this->_multiWebSeptic( 1, 1, undef, 0, <<EXPECT); 
    2329 EXPECT 
    2330 } 
    2331  
    2332 sub verify_multiWeb_with_header_with_footer_empty_separator_with_results { 
    2333     my $this = shift; 
    2334     $this->_multiWebSeptic( 1, 1, "", 1, <<EXPECT); 
     2772FOSWIKI11 
     2773 
     2774    return; 
     2775} 
     2776 
     2777sub test_multiWeb_with_header_with_footer_no_separator_no_results { 
     2778    my $this = shift; 
     2779    $this->_multiWebSeptic( 1, 1, undef, 0, undef, <<'FOSWIKI12'); 
     2780FOSWIKI12 
     2781 
     2782    return; 
     2783} 
     2784 
     2785sub test_multiWeb_with_header_with_footer_empty_separator_with_results { 
     2786    my $this = shift; 
     2787    $this->_multiWebSeptic( 
     2788        1, 1, "", 1, undef, <<'FOSWIKI12', 
     2789HEAD(Main)SitePreferencesWebPreferencesFOOT(2,2)HEAD(System)DefaultPreferencesWebPreferencesFOOT(2,2) 
     2790FOSWIKI12 
     2791        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    23352792HEAD(System)DefaultPreferencesWebPreferencesFOOT(2,2)HEAD(Main)SitePreferencesWebPreferencesFOOT(2,2) 
    2336 EXPECT 
    2337 } 
    2338  
    2339 sub verify_multiWeb_with_header_with_footer_empty_separator_no_results { 
    2340     my $this = shift; 
    2341     $this->_multiWebSeptic( 1, 1, "", 0, <<EXPECT); 
    2342 EXPECT 
    2343 } 
    2344  
    2345 sub verify_multiWeb_with_header_with_footer_with_separator_with_results { 
    2346     my $this = shift; 
    2347     $this->_multiWebSeptic( 1, 1, ",", 1, <<EXPECT); 
     2793FOSWIKI11 
     2794 
     2795    return; 
     2796} 
     2797 
     2798sub test_multiWeb_with_header_with_footer_empty_separator_no_results { 
     2799    my $this = shift; 
     2800    $this->_multiWebSeptic( 1, 1, "", 0, undef, <<'FOSWIKI12'); 
     2801FOSWIKI12 
     2802 
     2803    return; 
     2804} 
     2805 
     2806sub test_multiWeb_with_header_with_footer_with_separator_with_results { 
     2807    my $this = shift; 
     2808    $this->_multiWebSeptic( 
     2809        1, 1, ",", 1, undef, <<'FOSWIKI12', 
     2810HEAD(Main)SitePreferences,WebPreferencesFOOT(2,2)HEAD(System)DefaultPreferences,WebPreferencesFOOT(2,2) 
     2811FOSWIKI12 
     2812        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    23482813HEAD(System)DefaultPreferences,WebPreferencesFOOT(2,2)HEAD(Main)SitePreferences,WebPreferencesFOOT(2,2) 
    2349 EXPECT 
    2350 } 
    2351  
    2352 sub verify_multiWeb_with_header_with_footer_with_separator_no_results { 
    2353     my $this = shift; 
    2354     $this->_multiWebSeptic( 1, 1, ",", 0, <<EXPECT); 
    2355 EXPECT 
     2814FOSWIKI11 
     2815 
     2816    return; 
     2817} 
     2818 
     2819sub test_multiWeb_with_header_with_footer_with_separator_no_results { 
     2820    my $this = shift; 
     2821    $this->_multiWebSeptic( 1, 1, ",", 0, undef, <<'FOSWIKI12'); 
     2822FOSWIKI12 
     2823 
     2824    return; 
    23562825} 
    23572826 
    23582827##################### 
    23592828 
    2360 sub verify_multiWeb_with_header_no_footer_no_separator_with_results { 
    2361     my $this = shift; 
    2362     $this->_multiWebSeptic( 1, 0, undef, 1, <<EXPECT); 
     2829sub test_multiWeb_with_header_no_footer_no_separator_with_results { 
     2830    my $this = shift; 
     2831    $this->_multiWebSeptic( 
     2832        1, 0, undef, 1, undef, <<'FOSWIKI12', 
     2833HEAD(Main) 
     2834SitePreferences 
     2835WebPreferences 
     2836HEAD(System) 
     2837DefaultPreferences 
     2838WebPreferences 
     2839FOSWIKI12 
     2840        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    23632841HEAD(System) 
    23642842DefaultPreferences 
     
    23672845SitePreferences 
    23682846WebPreferences 
    2369 EXPECT 
    2370 } 
    2371  
    2372 sub verify_multiWeb_with_header_no_footer_no_separator_no_results { 
    2373     my $this = shift; 
    2374     $this->_multiWebSeptic( 1, 0, undef, 0, <<EXPECT); 
    2375 EXPECT 
    2376 } 
    2377  
    2378 sub verify_multiWeb_with_header_no_footer_empty_separator_with_results { 
    2379     my $this = shift; 
    2380     $this->_multiWebSeptic( 1, 0, "", 1, <<EXPECT); 
     2847FOSWIKI11 
     2848 
     2849    return; 
     2850} 
     2851 
     2852sub test_multiWeb_with_header_no_footer_no_separator_no_results { 
     2853    my $this = shift; 
     2854    $this->_multiWebSeptic( 1, 0, undef, 0, undef, <<'FOSWIKI12'); 
     2855FOSWIKI12 
     2856 
     2857    return; 
     2858} 
     2859 
     2860sub test_multiWeb_with_header_no_footer_empty_separator_with_results { 
     2861    my $this = shift; 
     2862    $this->_multiWebSeptic( 
     2863        1, 0, "", 1, undef, <<'FOSWIKI12', 
     2864HEAD(Main)SitePreferencesWebPreferencesHEAD(System)DefaultPreferencesWebPreferences 
     2865FOSWIKI12 
     2866        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    23812867HEAD(System)DefaultPreferencesWebPreferencesHEAD(Main)SitePreferencesWebPreferences 
    2382 EXPECT 
    2383 } 
    2384  
    2385 sub verify_multiWeb_with_header_no_footer_empty_separator_no_results { 
    2386     my $this = shift; 
    2387     $this->_multiWebSeptic( 1, 0, "", 0, <<EXPECT); 
    2388 EXPECT 
    2389 } 
    2390  
    2391 sub verify_multiWeb_with_header_no_footer_with_separator_with_results { 
    2392     my $this = shift; 
    2393     $this->_multiWebSeptic( 1, 0, ",", 1, <<EXPECT); 
     2868FOSWIKI11 
     2869 
     2870    return; 
     2871} 
     2872 
     2873sub test_multiWeb_with_header_no_footer_empty_separator_no_results { 
     2874    my $this = shift; 
     2875    $this->_multiWebSeptic( 1, 0, "", 0, undef, <<'FOSWIKI12'); 
     2876FOSWIKI12 
     2877 
     2878    return; 
     2879} 
     2880 
     2881sub test_multiWeb_with_header_no_footer_with_separator_with_results { 
     2882    my $this = shift; 
     2883    $this->_multiWebSeptic( 
     2884        1, 0, ",", 1, undef, <<'FOSWIKI12', 
     2885HEAD(Main)SitePreferences,WebPreferencesHEAD(System)DefaultPreferences,WebPreferences 
     2886FOSWIKI12 
     2887        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    23942888HEAD(System)DefaultPreferences,WebPreferencesHEAD(Main)SitePreferences,WebPreferences 
    2395 EXPECT 
    2396 } 
    2397  
    2398 sub verify_multiWeb_with_header_no_footer_with_separator_no_results { 
    2399     my $this = shift; 
    2400     $this->_multiWebSeptic( 1, 0, ",", 0, <<EXPECT); 
    2401 EXPECT 
     2889FOSWIKI11 
     2890 
     2891    return; 
     2892} 
     2893 
     2894sub test_multiWeb_with_header_no_footer_with_separator_no_results { 
     2895    my $this = shift; 
     2896    $this->_multiWebSeptic( 1, 0, ",", 0, undef, <<'FOSWIKI12'); 
     2897FOSWIKI12 
     2898 
     2899    return; 
    24022900} 
    24032901 
    24042902#Item1992: calling Foswiki::Search::_makeTopicPattern repeatedly made a big mess. 
    2405 sub verify_web_and_topic_expansion { 
     2903sub test_web_and_topic_expansion { 
    24062904    my $this   = shift; 
    24072905    my $result = $this->{test_topicObject}->expandMacros( 
     
    24172915        }%' 
    24182916    ); 
    2419     my $expected = <<EXPECT; 
     2917    my $expected = $this->_expect_with_deps( 
     2918        <<'FOSWIKI12', 
     2919Main.WebHome 
     2920Main.WebPreferences 
     2921FOOT(2,2)Sandbox.WebHome 
     2922Sandbox.WebPreferences 
     2923FOOT(2,2)System.WebHome 
     2924System.WebPreferences 
     2925FOOT(2,2) 
     2926FOSWIKI12 
     2927        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    24202928System.WebHome 
    24212929System.WebPreferences 
     
    24252933Sandbox.WebPreferences 
    24262934FOOT(2,2) 
    2427 EXPECT 
     2935FOSWIKI11 
    24282936    $expected =~ s/\n$//s; 
    24292937    $this->assert_str_equals( $expected, $result ); 
     2938 
     2939    return; 
    24302940} 
    24312941 
    24322942##################### 
    24332943# PAGING 
    2434 sub verify_paging_three_webs_first_five { 
    2435     my $this = shift; 
    2436  
     2944sub test_paging_three_webs_first_page { 
     2945    my $this   = shift; 
    24372946    my $result = $this->{test_topicObject}->expandMacros( 
    24382947        '%SEARCH{ 
     
    24502959    ); 
    24512960 
    2452     my $expected = <<EXPECT; 
     2961    my $expected = $this->_expect_with_deps( 
     2962        <<'FOSWIKI12', 
     2963Main.WebChanges 
     2964Main.WebHome 
     2965Main.WebIndex 
     2966Main.WebPreferences 
     2967FOOT(4,4)Sandbox.WebChanges 
     2968FOOT(1,1) 
     2969FOSWIKI12 
     2970        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    24532971System.WebChanges 
    24542972System.WebHome 
     
    24572975FOOT(4,4)Main.WebChanges 
    24582976FOOT(1,1) 
    2459 EXPECT 
     2977FOSWIKI11 
    24602978    $expected =~ s/\n$//s; 
    24612979    $this->assert_str_equals( $expected, $result ); 
    2462 } 
    2463  
    2464 sub verify_paging_three_webs_second_five { 
     2980 
     2981    return; 
     2982} 
     2983 
     2984sub test_paging_three_webs_second_page { 
    24652985    my $this = shift; 
    24662986 
     
    24803000    ); 
    24813001 
    2482     my $expected = <<EXPECT; 
     3002    my $expected = $this->_expect_with_deps( 
     3003        <<'FOSWIKI12', 
     3004Sandbox.WebHome 
     3005Sandbox.WebIndex 
     3006Sandbox.WebPreferences 
     3007FOOT(3,3)System.WebChanges 
     3008System.WebHome 
     3009FOOT(2,2) 
     3010FOSWIKI12 
     3011        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    24833012Main.WebHome 
    24843013Main.WebIndex 
     
    24873016Sandbox.WebHome 
    24883017FOOT(2,2) 
    2489 EXPECT 
     3018FOSWIKI11 
    24903019    $expected =~ s/\n$//s; 
    24913020    $this->assert_str_equals( $expected, $result ); 
    2492 } 
    2493  
    2494 sub verify_paging_three_webs_third_five { 
     3021 
     3022    return; 
     3023} 
     3024 
     3025sub test_paging_three_webs_third_page { 
    24953026    my $this = shift; 
    24963027 
     
    25103041    ); 
    25113042 
    2512     my $expected = <<EXPECT; 
     3043    my $expected = $this->_expect_with_deps( 
     3044        <<'FOSWIKI12', 
     3045System.WebIndex 
     3046System.WebPreferences 
     3047FOOT(2,2) 
     3048FOSWIKI12 
     3049        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    25133050Sandbox.WebIndex 
    25143051Sandbox.WebPreferences 
    25153052FOOT(2,2) 
    2516 EXPECT 
     3053FOSWIKI11 
    25173054    $expected =~ s/\n$//s; 
    25183055    $this->assert_str_equals( $expected, $result ); 
    2519 } 
    2520  
    2521 sub verify_paging_three_webs_fourth_five { 
     3056 
     3057    return; 
     3058} 
     3059 
     3060sub test_paging_three_webs_fourth_page { 
    25223061    my $this = shift; 
    25233062 
     
    25373076    ); 
    25383077 
    2539     my $expected = <<EXPECT; 
     3078    my $expected = <<'EXPECT'; 
    25403079EXPECT 
    25413080    $expected =~ s/\n$//s; 
    25423081    $this->assert_str_equals( $expected, $result ); 
    2543 } 
    2544  
    2545 sub verify_paging_three_webs_way_too_far { 
     3082 
     3083    return; 
     3084} 
     3085 
     3086sub test_paging_three_webs_way_too_far { 
    25463087    my $this = shift; 
    25473088 
     
    25613102    ); 
    25623103 
    2563     my $expected = <<EXPECT; 
     3104    my $expected = <<'EXPECT'; 
    25643105EXPECT 
    25653106    $expected =~ s/\n$//s; 
    25663107    $this->assert_str_equals( $expected, $result ); 
     3108 
     3109    return; 
    25673110} 
    25683111 
     
    25863129}%' 
    25873130    ); 
    2588  
    2589     my $expected = <<EXPECT; 
     3131    my $expected = $this->_expect_with_deps( 
     3132        <<'FOSWIKI12', 
     3133Main.WebPreferences 
     3134FOOT(1,1) 
     3135Sandbox.WebPreferences 
     3136FOOT(1,1) 
     3137System.WebPreferences 
     3138FOOT(1,1) 
     3139FOSWIKI12 
     3140        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    25903141System.WebPreferences 
    25913142FOOT(1,1) 
     
    25943145Sandbox.WebPreferences 
    25953146FOOT(1,1) 
    2596 EXPECT 
     3147FOSWIKI11 
     3148 
    25973149    $expected =~ s/\n$//s; 
    25983150    $this->assert_str_equals( $expected, $result ); 
     3151 
     3152    return; 
    25993153} 
    26003154 
    26013155#------------------------------------ 
    26023156# PAGING with limit= does weird things. 
    2603 sub verify_paging_with_limit_first_five { 
     3157sub test_paging_with_limit_first_page { 
    26043158    my $this = shift; 
    26053159 
     
    26203174    ); 
    26213175 
    2622     my $expected = <<EXPECT; 
     3176    my $expected = $this->_expect_with_deps( 
     3177        <<'FOSWIKI12', 
     3178Main.WebChanges 
     3179Main.WebHome 
     3180Main.WebIndex 
     3181FOOT(3,3) 
     3182FOSWIKI12 
     3183        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    26233184System.WebChanges 
    26243185System.WebHome 
    26253186System.WebIndex 
    26263187FOOT(3,3) 
    2627 EXPECT 
     3188FOSWIKI11 
    26283189    $expected =~ s/\n$//s; 
    26293190    $this->assert_str_equals( $expected, $result ); 
    2630 } 
    2631  
    2632 sub verify_paging_with_limit_second_five { 
     3191 
     3192    return; 
     3193} 
     3194 
     3195sub test_paging_with_limit_second_page { 
    26333196    my $this = shift; 
    26343197 
     
    26493212    ); 
    26503213 
    2651     my $expected = <<EXPECT; 
     3214    my $expected = $this->_expect_with_deps( 
     3215        <<'FOSWIKI12', 
     3216Sandbox.WebChanges 
     3217Sandbox.WebHome 
     3218Sandbox.WebIndex 
     3219FOOT(3,3) 
     3220FOSWIKI12 
     3221        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    26523222Main.WebChanges 
    26533223Main.WebHome 
    26543224Main.WebIndex 
    26553225FOOT(3,3) 
    2656 EXPECT 
     3226FOSWIKI11 
    26573227    $expected =~ s/\n$//s; 
    26583228    $this->assert_str_equals( $expected, $result ); 
    2659 } 
    2660  
    2661 sub verify_paging_with_limit_third_five { 
     3229 
     3230    return; 
     3231} 
     3232 
     3233sub test_paging_with_limit_third_page { 
    26623234    my $this = shift; 
    26633235 
     
    26783250    ); 
    26793251 
    2680     my $expected = <<EXPECT; 
     3252    my $expected = $this->_expect_with_deps( 
     3253        <<'FOSWIKI12', 
     3254System.WebChanges 
     3255System.WebHome 
     3256System.WebIndex 
     3257FOOT(3,3) 
     3258FOSWIKI12 
     3259        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    26813260Sandbox.WebChanges 
    26823261Sandbox.WebHome 
    26833262Sandbox.WebIndex 
    26843263FOOT(3,3) 
    2685 EXPECT 
     3264FOSWIKI11 
    26863265    $expected =~ s/\n$//s; 
    26873266    $this->assert_str_equals( $expected, $result ); 
    2688 } 
    2689  
    2690 sub verify_paging_with_limit_fourth_five { 
     3267 
     3268    return; 
     3269} 
     3270 
     3271sub test_paging_with_limit_fourth_page { 
    26913272    my $this = shift; 
    26923273 
     
    27073288    ); 
    27083289 
    2709     my $expected = <<EXPECT; 
     3290    my $expected = <<'EXPECT'; 
    27103291EXPECT 
    27113292    $expected =~ s/\n$//s; 
    27123293    $this->assert_str_equals( $expected, $result ); 
    2713 } 
    2714  
    2715 sub verify_paging_with_limit_way_too_far { 
     3294 
     3295    return; 
     3296} 
     3297 
     3298sub test_paging_with_limit_way_too_far { 
    27163299    my $this = shift; 
    27173300 
     
    27323315    ); 
    27333316 
    2734     my $expected = <<EXPECT; 
     3317    my $expected = <<'EXPECT'; 
    27353318EXPECT 
    27363319    $expected =~ s/\n$//s; 
    27373320    $this->assert_str_equals( $expected, $result ); 
     3321 
     3322    return; 
    27383323} 
    27393324 
     
    27453330#TODO: this is how the code has always worked, as the rendering of SEARCH results is done per web 
    27463331#http://foswiki.org/Development/MakeSEARCHResultPartitioningByWebOptional 
    2747 sub verify_groupby_none_using_subwebs { 
     3332sub test_groupby_none_using_subwebs { 
    27483333    my $this = shift; 
    27493334 
     
    27513336      Foswiki::Meta->new( $this->{session}, "$this->{test_web}/A" ); 
    27523337    $webObject->populateNewWeb(); 
    2753     my $topicObject = 
    2754       Foswiki::Meta->new( $this->{session}, "$this->{test_web}/A", 'TheTopic', 
    2755         <<CRUD); 
     3338    $webObject->finish(); 
     3339    my ($topicObject) = 
     3340      Foswiki::Func::readTopic( "$this->{test_web}/A", 'TheTopic' ); 
     3341    $topicObject->text( <<'CRUD'); 
    27563342%META:FORM{name="TestForm"}% 
    27573343%META:FIELD{name="Order" title="Order" value="3"}% 
    27583344CRUD 
    27593345    $topicObject->save( forcedate => 1000 ); 
     3346    $topicObject->finish(); 
    27603347 
    27613348    $webObject = Foswiki::Meta->new( $this->{session}, "$this->{test_web}/B" ); 
    27623349    $webObject->populateNewWeb(); 
    2763     $topicObject = 
    2764       Foswiki::Meta->new( $this->{session}, "$this->{test_web}/B", 'TheTopic', 
    2765         <<CRUD); 
     3350    $webObject->finish(); 
     3351    ($topicObject) = 
     3352      Foswiki::Func::readTopic( "$this->{test_web}/B", 'TheTopic' ); 
     3353    $topicObject->text( <<'CRUD'); 
    27663354%META:FORM{name="TestForm"}% 
    27673355%META:FIELD{name="Order" title="Order" value="1"}% 
    27683356CRUD 
    27693357    $topicObject->save( forcedate => 100 ); 
     3358    $topicObject->finish(); 
    27703359 
    27713360    $webObject = Foswiki::Meta->new( $this->{session}, "$this->{test_web}/C" ); 
    27723361    $webObject->populateNewWeb(); 
    2773     $topicObject = 
    2774       Foswiki::Meta->new( $this->{session}, "$this->{test_web}/C", 'TheTopic', 
    2775         <<CRUD); 
     3362    $webObject->finish(); 
     3363    ($topicObject) = 
     3364      Foswiki::Func::readTopic( "$this->{test_web}/C", 'TheTopic' ); 
     3365    $topicObject->text( <<'CRUD'); 
    27763366%META:FORM{name="TestForm"}% 
    27773367%META:FIELD{name="Order" title="Order" value="2"}% 
    27783368CRUD 
    27793369    $topicObject->save( forcedate => 500 ); 
     3370    $topicObject->finish(); 
     3371    my $result; 
    27803372 
    27813373    #order by formfield, with groupby=none 
    2782     my $result = $this->{test_topicObject}->expandMacros( <<GNURF ); 
     3374    $result = $this->{test_topicObject}->expandMacros( <<"GNURF" ); 
    27833375%SEARCH{"Order!=''" 
    27843376 type="query" 
     
    27983390 
    27993391    #order by modified date, reverse=off, with groupby=none 
    2800     $result = $this->{test_topicObject}->expandMacros( <<GNURF ); 
     3392    $result = $this->{test_topicObject}->expandMacros( <<"GNURF" ); 
    28013393%SEARCH{"Order!=''" 
    28023394 type="query" 
     
    28183410 
    28193411    #order by modified date, reverse=n, with groupby=none 
    2820     $result = $this->{test_topicObject}->expandMacros( <<GNURF ); 
     3412    $result = $this->{test_topicObject}->expandMacros( <<"GNURF" ); 
    28213413%SEARCH{"Order!=''" 
    28223414 type="query" 
     
    28393431#and the same again, this time using header&footer, as that is what really shows the issue. 
    28403432#order by formfield, with groupby=none 
    2841     $result = $this->{test_topicObject}->expandMacros( <<GNURF ); 
     3433    $result = $this->{test_topicObject}->expandMacros( <<"GNURF" ); 
    28423434%SEARCH{"Order!=''" 
    28433435 type="query" 
     
    28603452 
    28613453    #order by modified date, reverse=off, with groupby=none 
    2862     $result = $this->{test_topicObject}->expandMacros( <<GNURF ); 
     3454    $result = $this->{test_topicObject}->expandMacros( <<"GNURF" ); 
    28633455%SEARCH{"Order!=''" 
    28643456 type="query" 
     
    28823474 
    28833475    #order by modified date, reverse=n, with groupby=none 
    2884     $result = $this->{test_topicObject}->expandMacros( <<GNURF ); 
     3476    $result = $this->{test_topicObject}->expandMacros( <<"GNURF" ); 
    28853477%SEARCH{"Order!=''" 
    28863478 type="query" 
     
    29083500    my %testWebs = ( Main => 0, System => 10, Sandbox => 100 ); 
    29093501    while ( my ( $web, $delay ) = each %testWebs ) { 
    2910         my $topicObject = 
    2911           Foswiki::Meta->new( $this->{session}, "$web", 'TheTopic', <<'CRUD'); 
     3502        my ($ltopicObject) = Foswiki::Func::readTopic( "$web", 'TheTopic' ); 
     3503        $ltopicObject->text(<<'CRUD'); 
    29123504Just some dummy search topic. 
    29133505CRUD 
    2914         $topicObject->save( forcedate => $delay ); 
     3506        $ltopicObject->save( forcedate => $delay ); 
     3507        $ltopicObject->finish(); 
    29153508    } 
    29163509 
    2917     $result = $this->{test_topicObject}->expandMacros( <<GNURF ); 
     3510    $result = $this->{test_topicObject}->expandMacros( <<"GNURF" ); 
    29183511%SEARCH{"1" 
    29193512 type="query" 
     
    29333526    $this->assert_equals( "HEADERSystem TheTopic, Sandbox TheTopicFOOTER\n", 
    29343527        $result ); 
     3528 
     3529    return; 
    29353530} 
    29363531 
     
    29483543} 
    29493544 
    2950 sub verify_no_format_no_shit { 
     3545sub test_no_format_no_shit { 
    29513546    my $this = shift; 
    29523547 
    29533548    my $result = $this->{test_topicObject}->expandMacros('%SEARCH{"BLEEGLE"}%'); 
    2954     $this->assert_html_equals( <<'CRUD', _cut_the_crap($result) ); 
    2955 Searched: <noautolink>BLEEGLE</noautolink>Results from <nop>TemporarySEARCHTestWebSEARCH web retrieved at TIME 
     3549    $this->assert_html_equals( <<"CRUD", _cut_the_crap($result) ); 
     3550Searched: <noautolink>BLEEGLE</noautolink>Results from <nop>$this->{test_web} web retrieved at TIME 
    29563551 
    29573552<a href="">OkATopic</a> 
     
    29773572    my $session = $this->{session}; 
    29783573    if ( !$session->topicExists( 'TemporarySEARCHUsersWeb', 'WikiGuest' ) ) { 
    2979         my $userTopic = Foswiki::Meta->new( 
    2980             $session,    'TemporarySEARCHUsersWeb', 
    2981             'WikiGuest', 'Just this poor old WikiGuest' 
    2982         ); 
     3574        my ($userTopic) = 
     3575          Foswiki::Func::readTopic( 'TemporarySEARCHUsersWeb', 'WikiGuest' ); 
     3576        $userTopic->text('Just this poor old WikiGuest'); 
    29833577        $userTopic->save(); 
     3578        $userTopic->finish(); 
    29843579    } 
    29853580    $this->assert( 
     
    29913586      $this->{test_topicObject} 
    29923587      ->expandMacros('%SEARCH{"BLEEGLE" nosummary="on"}%'); 
    2993     $this->assert_html_equals( <<CRUD, _cut_the_crap($result) ); 
    2994 Searched: <noautolink>BLEEGLE</noautolink>Results from <nop>TemporarySEARCHTestWebSEARCH web retrieved at TIME 
     3588    $this->assert_html_equals( <<"CRUD", _cut_the_crap($result) ); 
     3589Searched: <noautolink>BLEEGLE</noautolink>Results from <nop>$this->{test_web} web retrieved at TIME 
    29953590 
    29963591<a href="">OkATopic</a> 
     
    30113606      $this->{test_topicObject} 
    30123607      ->expandMacros('%SEARCH{"BLEEGLE" nosearch="on"}%'); 
    3013     $this->assert_html_equals( <<CRUD, _cut_the_crap($result) ); 
    3014 Results from <nop>TemporarySEARCHTestWebSEARCH web retrieved at TIME 
     3608    $this->assert_html_equals( <<"CRUD", _cut_the_crap($result) ); 
     3609Results from <nop>$this->{test_web} web retrieved at TIME 
    30153610 
    30163611<a href="">OkATopic</a> 
     
    30363631      $this->{test_topicObject} 
    30373632      ->expandMacros('%SEARCH{"BLEEGLE" nototal="on"}%'); 
    3038     $this->assert_html_equals( <<CRUD, _cut_the_crap($result) ); 
     3633    $this->assert_html_equals( <<"CRUD", _cut_the_crap($result) ); 
    30393634Searched: <noautolink>BLEEGLE</noautolink> 
    3040 Results from <nop>TemporarySEARCHTestWebSEARCH web retrieved at TIME 
     3635Results from <nop>$this->{test_web} web retrieved at TIME 
    30413636 
    30423637<a href="">OkATopic</a> 
     
    30623657      $this->{test_topicObject} 
    30633658      ->expandMacros('%SEARCH{"BLEEGLE" noheader="on"}%'); 
    3064     $this->assert_html_equals( <<CRUD, _cut_the_crap($result) ); 
     3659    $this->assert_html_equals( <<"CRUD", _cut_the_crap($result) ); 
    30653660Searched: <noautolink>BLEEGLE</noautolink> 
    30663661<a href="">OkATopic</a> 
     
    30853680      $this->{test_topicObject} 
    30863681      ->expandMacros('%SEARCH{"BLEEGLE" noempty="on"}%'); 
    3087     $this->assert_html_equals( <<CRUD, _cut_the_crap($result) ); 
     3682    $this->assert_html_equals( <<"CRUD", _cut_the_crap($result) ); 
    30883683Searched: <noautolink>BLEEGLE</noautolink> 
    3089 Results from <nop>TemporarySEARCHTestWebSEARCH web retrieved at TIME 
     3684Results from <nop>$this->{test_web} web retrieved at TIME 
    30903685 
    30913686 
     
    31133708      $this->{test_topicObject} 
    31143709      ->expandMacros('%SEARCH{"BLEEGLE" zeroresults="on"}%'); 
    3115     $this->assert_html_equals( <<CRUD, _cut_the_crap($result) ); 
     3710    $this->assert_html_equals( <<"CRUD", _cut_the_crap($result) ); 
    31163711Searched: <noautolink>BLEEGLE</noautolink> 
    3117 Results from <nop>TemporarySEARCHTestWebSEARCH web retrieved at TIME 
     3712Results from <nop>$this->{test_web} web retrieved at TIME 
    31183713 
    31193714 
     
    31473742      ->expandMacros('%SEARCH{"BLEEGLE" nosummary="on" nonoise="on"}%'); 
    31483743    $this->assert_html_equals( $result, $result2 ); 
     3744 
     3745    return; 
    31493746} 
    31503747 
     
    32113808    my $not_quote_dontcount = $#list; 
    32123809    $this->assert( $not_quote_dontcount == 4 ); 
     3810 
     3811    return; 
    32133812} 
    32143813 
     
    32753874    my $not_quote_dontcount = $#list; 
    32763875    $this->assert( $not_quote_dontcount == 4 ); 
     3876 
     3877    return; 
    32773878} 
    32783879 
     
    33363937    my $not_quote_dontcount = $#list; 
    33373938    $this->assert( $not_quote_dontcount == 4 ); 
     3939 
     3940    return; 
    33383941} 
    33393942 
     
    33974000    my $not_quote_dontcount = $#list; 
    33984001    $this->assert( $not_quote_dontcount == 4 ); 
     4002 
     4003    return; 
    33994004} 
    34004005 
     
    34094014    my $TEST_TEXT  = "xxx Shamira"; 
    34104015    my $TEST_TOPIC = 'StopWordTestTopic'; 
    3411     my $topicObject = 
    3412       Foswiki::Meta->new( $this->{session}, $this->{test_web}, $TEST_TOPIC, 
    3413         $TEST_TEXT ); 
     4016    my ($topicObject) = 
     4017      Foswiki::Func::readTopic( $this->{test_web}, $TEST_TOPIC ); 
     4018    $topicObject->text($TEST_TEXT); 
    34144019    $topicObject->save(); 
     4020    $topicObject->finish(); 
    34154021 
    34164022    my $result = 
     
    34404046 
    34414047    Foswiki::Func::setPreferencesValue( 'SEARCHSTOPWORDS', $origSetting ); 
     4048 
     4049    return; 
    34424050} 
    34434051 
     
    34584066        Alan says: 'Oh yes; I knew I'd seen them somewhere before! But how do I know I won't go mad and do something to you? I just thought of something, just then.' Alan is now very agitated. 'It makes my blood boil the way analysts never defend themselves when they are attacked in the press. You hear one slander after another about Freud and psychoanalysis, and what do your lot do? Nothing!'"; 
    34594067 
    3460     my $topicObject = 
    3461       Foswiki::Meta->new( $this->{session}, $this->{test_web}, $topicName, 
    3462         $TEST_SUMMARY_TEXT ); 
     4068    my ($topicObject) = 
     4069      Foswiki::Func::readTopic( $this->{test_web}, $topicName ); 
     4070    $topicObject->text($TEST_SUMMARY_TEXT); 
    34634071    $topicObject->save(); 
     4072    $topicObject->finish(); 
     4073 
     4074    return; 
    34644075} 
    34654076 
     
    34704081=cut 
    34714082 
    3472 sub verify_summary_default_word_search { 
     4083sub test_summary_default_word_search { 
    34734084    my $this = shift; 
    34744085 
     
    34804091      ); 
    34814092 
    3482     $this->assert_html_equals( <<CRUD, $result ); 
     4093    $this->assert_html_equals( <<'CRUD', $result ); 
    34834094Alan says<nop>: 'I was on a landing; there were banisters'. He pauses before describing the exact shape and details of the banisters. 'There was a thin man there. I was ... 
    34844095CRUD 
     4096 
     4097    return; 
    34854098} 
    34864099 
     
    34914104=cut 
    34924105 
    3493 sub verify_summary_short_word_search { 
     4106sub test_summary_short_word_search { 
    34944107    my $this = shift; 
    34954108 
     
    35014114      ); 
    35024115 
    3503     $this->assert_html_equals( <<CRUD, $result ); 
     4116    $this->assert_html_equals( <<'CRUD', $result ); 
    35044117Alan says<nop>: 'I was ... 
    35054118CRUD 
     4119 
     4120    return; 
    35064121} 
    35074122 
     
    35124127=cut 
    35134128 
    3514 sub verify_summary_searchcontext_default_word_search { 
     4129sub test_summary_searchcontext_default_word_search { 
    35154130    my $this = shift; 
    35164131 
     
    35224137      ); 
    35234138 
    3524     $this->assert_html_equals( <<CRUD, $result ); 
     4139    $this->assert_html_equals( <<'CRUD', $result ); 
    35254140<b>&hellip;</b>  his analysis and his need to <em>do</em> it very carefully. He knows  <b>&hellip;</b>  somewhere before! But how <em>do</em> I know I won't go mad and do  <b>&hellip;</b>  and psychoanalysis, and what <em>do</em> your lot do? Nothing <b>&hellip;</b> 
    35264141CRUD 
     4142 
     4143    return; 
    35274144} 
    35284145 
     
    35334150=cut 
    35344151 
    3535 sub verify_summary_searchcontext_short_word_search { 
     4152sub test_summary_searchcontext_short_word_search { 
    35364153    my $this = shift; 
    35374154 
     
    35434160      ); 
    35444161 
    3545     $this->assert_html_equals( <<CRUD, $result ); 
     4162    $this->assert_html_equals( <<'CRUD', $result ); 
    35464163<b>&hellip;</b>  topple over too; might lose <em>his</em> balance. As Alan thought  <b>&hellip;</b>  
    35474164CRUD 
     4165 
     4166    return; 
    35484167} 
    35494168 
     
    35544173=cut 
    35554174 
    3556 sub verify_summary_searchcontext_long_word_search { 
     4175sub test_summary_searchcontext_long_word_search { 
    35574176    my $this = shift; 
    35584177 
     
    35644183      ); 
    35654184 
    3566     $this->assert_html_equals( <<CRUD, $result ); 
     4185    $this->assert_html_equals( <<'CRUD', $result ); 
    35674186<b>&hellip;</b>  topple over too; might lose <em>his</em> balance. As Alan thought  <b>&hellip;</b> about different parts of <em>his</em> dream he let his mind follow  <b>&hellip;</b> came to him. He thought about <em>his</em> weight loss programme. He  <b>&hellip;</b>  later. Perhaps it's because <em>his</em> next goal is 18 stone, he  <b>&hellip;</b>  
    35684187CRUD 
     4188 
     4189    return; 
    35694190} 
    35704191 
     
    35744195 
    35754196    $result = $this->{test_topicObject}->expandMacros('%SEARCH{"NOBLEEGLE"}%'); 
    3576     $this->assert_html_equals( <<RESULT, _cut_the_crap($result) ); 
     4197    $this->assert_html_equals( <<'RESULT', _cut_the_crap($result) ); 
    35774198Searched: <noautolink>NOBLEEGLE</noautolink> 
    35784199Number of topics: 0 
     
    35824203      $this->{test_topicObject} 
    35834204      ->expandMacros('%SEARCH{"NOBLEEGLE" zeroresults="on"}%'); 
    3584     $this->assert_html_equals( <<RESULT, _cut_the_crap($result) ); 
     4205    $this->assert_html_equals( <<'RESULT', _cut_the_crap($result) ); 
    35854206Searched: <noautolink>NOBLEEGLE</noautolink> 
    35864207Number of topics: 0 
     
    36154236      $this->{test_topicObject}->expandMacros( 
    36164237        '%SEARCH{"NOBLEEGLE" zeroresults="I did not find anything."}%'); 
    3617     $this->assert_html_equals( <<RESULT, _cut_the_crap($result) ); 
     4238    $this->assert_html_equals( <<'RESULT', _cut_the_crap($result) ); 
    36184239I did not find anything. 
    36194240RESULT 
     
    36234244      $this->{test_topicObject} 
    36244245      ->expandMacros('%SEARCH{"NOBLEEGLE" nototal="on"}%'); 
    3625     $this->assert_html_equals( <<RESULT, _cut_the_crap($result) ); 
     4246    $this->assert_html_equals( <<'RESULT', _cut_the_crap($result) ); 
    36264247Searched: <noautolink>NOBLEEGLE</noautolink> 
    36274248RESULT 
     
    36304251      $this->{test_topicObject} 
    36314252      ->expandMacros('%SEARCH{"NOBLEEGLE" nototal="on" zeroresults="on"}%'); 
    3632     $this->assert_html_equals( <<RESULT, _cut_the_crap($result) ); 
     4253    $this->assert_html_equals( <<'RESULT', _cut_the_crap($result) ); 
    36334254Searched: <noautolink>NOBLEEGLE</noautolink> 
    36344255RESULT 
     
    36434264'%SEARCH{"NOBLEEGLE" nototal="on" zeroresults="I did not find anything."}%' 
    36444265      ); 
    3645     $this->assert_html_equals( <<RESULT, _cut_the_crap($result) ); 
     4266    $this->assert_html_equals( <<'RESULT', _cut_the_crap($result) ); 
    36464267I did not find anything. 
    36474268RESULT 
     
    36514272      $this->{test_topicObject} 
    36524273      ->expandMacros('%SEARCH{"NOBLEEGLE" nototal="off"}%'); 
    3653     $this->assert_html_equals( <<RESULT, _cut_the_crap($result) ); 
     4274    $this->assert_html_equals( <<'RESULT', _cut_the_crap($result) ); 
    36544275Searched: <noautolink>NOBLEEGLE</noautolink> 
    36554276Number of topics: 0 
     
    36594280      $this->{test_topicObject} 
    36604281      ->expandMacros('%SEARCH{"NOBLEEGLE" nototal="off" zeroresults="on"}%'); 
    3661     $this->assert_html_equals( <<RESULT, _cut_the_crap($result) ); 
     4282    $this->assert_html_equals( <<'RESULT', _cut_the_crap($result) ); 
    36624283Searched: <noautolink>NOBLEEGLE</noautolink> 
    36634284Number of topics: 0 
     
    36734294'%SEARCH{"NOBLEEGLE" nototal="off" zeroresults="I did not find anything."}%' 
    36744295      ); 
    3675     $this->assert_html_equals( <<RESULT, _cut_the_crap($result) ); 
     4296    $this->assert_html_equals( <<'RESULT', _cut_the_crap($result) ); 
    36764297I did not find anything. 
    36774298RESULT 
     4299 
     4300    return; 
    36784301} 
    36794302 
     
    36824305    my $this = shift; 
    36834306 
    3684     my $text = <<HERE; 
     4307    my $text = <<'HERE'; 
    36854308%META:TOPICINFO{author="TopicUserMapping_guest" date="1" format="1.1" version="1.2"}% 
    36864309---+ Progressive Sexuality 
     
    36884311 
    36894312HERE 
    3690     my $topicObject = 
    3691       Foswiki::Meta->new( $this->{session}, $this->{test_web}, "VeryOldTopic", 
    3692         $text ); 
     4313    my ($topicObject) = 
     4314      Foswiki::Func::readTopic( $this->{test_web}, "VeryOldTopic" ); 
     4315    $topicObject->text($text); 
    36934316    my $rev = $topicObject->save( forcedate => 86420 ); # > 86400, see Item10389 
    36944317    $this->assert_num_equals( 1, $rev ); 
     4318    $topicObject->finish(); 
    36954319 
    36964320    #TODO: sadly, the core Handlers don't set the filedate 
     
    37084332        '%SEARCH{"1" type="query" date="1970" nonoise="on" format="$topic"}%'); 
    37094333 
    3710     $this->assert_html_equals( <<RESULT, _cut_the_crap($result) ); 
     4334    $this->assert_html_equals( <<'RESULT', _cut_the_crap($result) ); 
    37114335VeryOldTopic 
    37124336RESULT 
     4337 
     4338    return; 
    37134339} 
    37144340 
    37154341sub verify_nl_in_result { 
    37164342    my $this = shift; 
    3717     my $text = <<HERE; 
    3718 %META:TOPICINFO{author="TopicUserMapping_guest" date="1" format="1.1" version="1.2"}% 
     4343    my $text = <<'HERE'; 
    37194344Radical Meta-Physics 
    37204345Marxism 
     
    37244349%META:FIELD{name="Name" attributes="" title="Name" value="Meta-Physics%0aMarxism%0aCrime%0aSuicide%0aPaganism."}% 
    37254350HERE 
    3726     my $topicObject = 
    3727       Foswiki::Meta->new( $this->{session}, $this->{test_web}, "OffColour", 
    3728         $text ); 
     4351    my ($topicObject) = 
     4352      Foswiki::Func::readTopic( $this->{test_web}, "OffColour" ); 
     4353    $topicObject->text($text); 
    37294354    $topicObject->save(); 
     4355    $topicObject->finish(); 
    37304356 
    37314357    my $result; 
     
    37374363'%SEARCH{"OffColour" scope="topic" nonoise="on" format="$formfield(Name)"}%' 
    37384364      ); 
    3739     $this->assert_str_equals( <<RESULT, "$result\n" ); 
     4365    $this->assert_str_equals( <<'RESULT', "$result\n" ); 
    37404366Meta-Physics<br />Marxism<br />Crime<br />Suicide<br />Paganism. 
    37414367RESULT 
     
    37464372'%SEARCH{"OffColour" scope="topic" nonoise="on" format="$pattern(.*?(Meta.*?Paganism).*)"}%' 
    37474373      ); 
    3748     $this->assert_str_equals( <<RESULT, "$result\n" ); 
     4374    $this->assert_str_equals( <<'RESULT', "$result\n" ); 
    37494375Meta-Physics 
    37504376Marxism 
     
    37594385'%SEARCH{"OffColour" scope="topic" nonoise="on" format="$pattern(.*?(Meta.*?Paganism).*)" newline="X"}%' 
    37604386      ); 
    3761     $this->assert_str_equals( <<RESULT, "$result\n" ); 
     4387    $this->assert_str_equals( <<'RESULT', "$result\n" ); 
    37624388Meta-PhysicsXMarxismXCrimeXSuicideXPaganism 
    37634389RESULT 
     
    37724398#Meta-PhysicsXMarxismXCrimeXSuicideXPaganism. 
    37734399#RESULT 
     4400 
     4401    return; 
    37744402} 
    37754403 
    37764404########################################### 
    37774405#pager formatting 
    3778 sub verify_pager_on { 
     4406sub test_pager_on { 
    37794407    my $this = shift; 
    37804408 
     
    37994427    ); 
    38004428 
    3801     my $expected = <<EXPECT; 
     4429    my $expected = $this->_expect_with_deps( 
     4430        <<"FOSWIKI12", 
     4431Main.WebChanges 
     4432Main.WebHome 
     4433Main.WebIndex 
     4434Main.WebPreferences 
     4435FOOT(4,4)Sandbox.WebChanges 
     4436FOOT(1,1)<div class="foswikiSearchResultsPager"> 
     4437   Page 1 of 3   [[$viewTopicUrl?SEARCHc6139cf1d63c9614230f742fca2c6a36=2][Next >]] 
     4438</div> 
     4439FOSWIKI12 
     4440        'Foswiki,<,1.2' => <<"FOSWIKI11"); 
    38024441System.WebChanges 
    38034442System.WebHome 
     
    38084447   Page 1 of 3   [[$viewTopicUrl?SEARCHc6139cf1d63c9614230f742fca2c6a36=2][Next >]] 
    38094448</div> 
    3810 EXPECT 
     4449FOSWIKI11 
    38114450    $expected =~ s/\n$//s; 
    38124451    $this->assert_str_equals( $expected, $result ); 
     
    38284467    ); 
    38294468 
    3830     $expected = <<EXPECT; 
     4469    $expected = $this->_expect_with_deps( 
     4470        <<"FOSWIKI12", 
     4471Sandbox.WebHome 
     4472Sandbox.WebIndex 
     4473Sandbox.WebPreferences 
     4474FOOT(3,3)System.WebChanges 
     4475System.WebHome 
     4476FOOT(2,2)<div class="foswikiSearchResultsPager"> 
     4477[[$viewTopicUrl?SEARCH6331ae02a320baf1478c8302e38b7577=1][< Previous]]   Page 2 of 3   [[$viewTopicUrl?SEARCH6331ae02a320baf1478c8302e38b7577=3][Next >]] 
     4478</div> 
     4479FOSWIKI12 
     4480        'Foswiki,<,1.2' => <<"FOSWIKI11"); 
    38314481Main.WebHome 
    38324482Main.WebIndex 
     
    38374487[[$viewTopicUrl?SEARCH6331ae02a320baf1478c8302e38b7577=1][< Previous]]   Page 2 of 3   [[$viewTopicUrl?SEARCH6331ae02a320baf1478c8302e38b7577=3][Next >]] 
    38384488</div> 
    3839 EXPECT 
     4489FOSWIKI11 
    38404490    $expected =~ s/\n$//s; 
    38414491    $this->assert_str_equals( $expected, $result ); 
    3842 } 
    3843  
    3844 sub verify_pager_on_pagerformat { 
     4492 
     4493    return; 
     4494} 
     4495 
     4496sub test_pager_on_pagerformat { 
    38454497    my $this = shift; 
    38464498 
     
    38494501        $this->{test_topicObject}->topic, 'view' ); 
    38504502 
    3851     my $result = $this->{test_topicObject}->expandMacros( 
    3852         '%SEARCH{ 
     4503    my $result = $this->{test_topicObject}->expandMacros(<<'EXPECT'); 
     4504%SEARCH{ 
    38534505    "web"  
    38544506    type="text" 
     
    38644516    pagerformat="$n..prev=$previouspage, $currentpage, next=$nextpage, numberofpages=$numberofpages, pagesize=$pagesize, prevurl=$previousurl, nexturl=$nexturl..$n" 
    38654517}% 
    3866 ' 
    3867     ); 
    3868  
    3869     my $expected = <<EXPECT; 
     4518EXPECT 
     4519 
     4520    my $expected = $this->_expect_with_deps( 
     4521        <<"FOSWIKI12", 
     4522Main.WebChanges 
     4523Main.WebHome 
     4524Main.WebIndex 
     4525Main.WebPreferences 
     4526FOOT(4,4)Sandbox.WebChanges 
     4527FOOT(1,1) 
     4528..prev=0, 1, next=2, numberofpages=3, pagesize=5, prevurl=, nexturl=$viewTopicUrl?SEARCHe9863b5d7ec27abeb8421578b0747c25=2.. 
     4529FOSWIKI12 
     4530        'Foswiki,<,1.2' => <<"FOSWIKI11"); 
    38704531System.WebChanges 
    38714532System.WebHome 
     
    38754536FOOT(1,1) 
    38764537..prev=0, 1, next=2, numberofpages=3, pagesize=5, prevurl=, nexturl=$viewTopicUrl?SEARCHe9863b5d7ec27abeb8421578b0747c25=2.. 
    3877 EXPECT 
     4538FOSWIKI11 
    38784539    $this->assert_str_equals( $expected, $result ); 
    38794540 
     
    38964557    ); 
    38974558 
    3898     $expected = <<EXPECT; 
     4559    $expected = $this->_expect_with_deps( 
     4560        <<"FOSWIKI12", 
     4561Sandbox.WebHome 
     4562Sandbox.WebIndex 
     4563Sandbox.WebPreferences 
     4564FOOT(3,3)System.WebChanges 
     4565System.WebHome 
     4566FOOT(2,2) 
     4567..prev=1, 2, next=3, numberofpages=3, pagesize=5, prevurl=$viewTopicUrl?SEARCHc5ceccfcec96473a9efe986cf3597eb1=1, nexturl=$viewTopicUrl?SEARCHc5ceccfcec96473a9efe986cf3597eb1=3.. 
     4568FOSWIKI12 
     4569        'Foswiki,<,1.2' => <<"FOSWIKI11"); 
    38994570Main.WebHome 
    39004571Main.WebIndex 
     
    39044575FOOT(2,2) 
    39054576..prev=1, 2, next=3, numberofpages=3, pagesize=5, prevurl=$viewTopicUrl?SEARCHc5ceccfcec96473a9efe986cf3597eb1=1, nexturl=$viewTopicUrl?SEARCHc5ceccfcec96473a9efe986cf3597eb1=3.. 
    3906 EXPECT 
     4577FOSWIKI11 
    39074578    $this->assert_str_equals( $expected, $result ); 
    3908 } 
    3909  
    3910 sub verify_pager_off_pagerformat { 
     4579 
     4580    return; 
     4581} 
     4582 
     4583sub test_pager_off_pagerformat { 
    39114584    my $this = shift; 
    39124585 
     
    39324605    ); 
    39334606 
    3934     my $expected = <<EXPECT; 
     4607    my $expected = $this->_expect_with_deps( 
     4608        <<'FOSWIKI12', 
     4609Main.WebChanges 
     4610Main.WebHome 
     4611Main.WebIndex 
     4612Main.WebPreferences 
     4613FOOT(4,4)Sandbox.WebChanges 
     4614FOOT(1,1) 
     4615FOSWIKI12 
     4616        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    39354617System.WebChanges 
    39364618System.WebHome 
     
    39394621FOOT(4,4)Main.WebChanges 
    39404622FOOT(1,1) 
    3941 EXPECT 
     4623FOSWIKI11 
    39424624    $expected =~ s/\n$//s; 
    39434625    $this->assert_str_equals( $expected, $result ); 
     
    39604642    ); 
    39614643 
    3962     $expected = <<EXPECT; 
     4644    $expected = $this->_expect_with_deps( 
     4645        <<'FOSWIKI12', 
     4646Sandbox.WebHome 
     4647Sandbox.WebIndex 
     4648Sandbox.WebPreferences 
     4649FOOT(3,3)System.WebChanges 
     4650System.WebHome 
     4651FOOT(2,2) 
     4652FOSWIKI12 
     4653        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    39634654Main.WebHome 
    39644655Main.WebIndex 
     
    39674658Sandbox.WebHome 
    39684659FOOT(2,2) 
    3969 EXPECT 
     4660FOSWIKI11 
    39704661    $expected =~ s/\n$//s; 
    39714662    $this->assert_str_equals( $expected, $result ); 
    3972 } 
    3973  
    3974 sub verify_pager_off_pagerformat_pagerinheaderfooter { 
     4663 
     4664    return; 
     4665} 
     4666 
     4667sub test_pager_off_pagerformat_pagerinheaderfooter { 
    39754668    my $this = shift; 
    39764669 
     
    39974690    ); 
    39984691 
    3999     my $expected = <<EXPECT; 
     4692    my $expected = $this->_expect_with_deps( 
     4693        <<'FOSWIKI12', 
     4694HEADER(..prev=0, 1, next=2, numberofpages=3, pagesize=5..) 
     4695Main.WebChanges 
     4696Main.WebHome 
     4697Main.WebIndex 
     4698Main.WebPreferences 
     4699FOOT(4,4)(..prev=0, 1, next=2, numberofpages=3, pagesize=5..)HEADER(..prev=0, 1, next=2, numberofpages=3, pagesize=5..) 
     4700Sandbox.WebChanges 
     4701FOOT(1,1)(..prev=0, 1, next=2, numberofpages=3, pagesize=5..) 
     4702FOSWIKI12 
     4703        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    40004704HEADER(..prev=0, 1, next=2, numberofpages=3, pagesize=5..) 
    40014705System.WebChanges 
     
    40064710Main.WebChanges 
    40074711FOOT(1,1)(..prev=0, 1, next=2, numberofpages=3, pagesize=5..) 
    4008 EXPECT 
     4712FOSWIKI11 
    40094713    $expected =~ s/\n$//s; 
    40104714    $this->assert_str_equals( $expected, $result ); 
     
    40284732    ); 
    40294733 
    4030     $expected = <<EXPECT; 
     4734    $expected = $this->_expect_with_deps( 
     4735        <<'FOSWIKI12', 
     4736HEADER(..prev=1, 2, next=3, numberofpages=3, pagesize=5..) 
     4737Sandbox.WebHome 
     4738Sandbox.WebIndex 
     4739Sandbox.WebPreferences 
     4740FOOT(3,3)(..prev=1, 2, next=3, numberofpages=3, pagesize=5..)HEADER(..prev=1, 2, next=3, numberofpages=3, pagesize=5..) 
     4741System.WebChanges 
     4742System.WebHome 
     4743FOOT(2,2)(..prev=1, 2, next=3, numberofpages=3, pagesize=5..) 
     4744FOSWIKI12 
     4745        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    40314746HEADER(..prev=1, 2, next=3, numberofpages=3, pagesize=5..) 
    40324747Main.WebHome 
     
    40374752Sandbox.WebHome 
    40384753FOOT(2,2)(..prev=1, 2, next=3, numberofpages=3, pagesize=5..) 
    4039 EXPECT 
     4754FOSWIKI11 
    40404755    $expected =~ s/\n$//s; 
    40414756    $this->assert_str_equals( $expected, $result ); 
     4757 
     4758    return; 
    40424759} 
    40434760 
     
    40634780    ); 
    40644781 
    4065     my $expected = <<EXPECT; 
     4782    my $expected = $this->_expect_with_deps( 
     4783        <<'FOSWIKI12', 
     4784HEADER(ntopics=0..prev=1, 2, next=3, numberofpages=3, pagesize=5..)ntopics=0 
     4785Sandbox.WebHome (ntopics=1..prev=1, 2, next=3, numberofpages=3, pagesize=5..)ntopics=1 
     4786Sandbox.WebIndex (ntopics=2..prev=1, 2, next=3, numberofpages=3, pagesize=5..)ntopics=2 
     4787Sandbox.WebPreferences (ntopics=3..prev=1, 2, next=3, numberofpages=3, pagesize=5..)ntopics=3 
     4788FOOT(3,3)(ntopics=3..prev=1, 2, next=3, numberofpages=3, pagesize=5..)HEADER(ntopics=0..prev=1, 2, next=3, numberofpages=3, pagesize=5..)ntopics=0 
     4789System.WebChanges (ntopics=1..prev=1, 2, next=3, numberofpages=3, pagesize=5..)ntopics=1 
     4790System.WebHome (ntopics=2..prev=1, 2, next=3, numberofpages=3, pagesize=5..)ntopics=2 
     4791FOOT(2,2)(ntopics=2..prev=1, 2, next=3, numberofpages=3, pagesize=5..) 
     4792FOSWIKI12 
     4793        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    40664794HEADER(ntopics=0..prev=1, 2, next=3, numberofpages=3, pagesize=5..)ntopics=0 
    40674795Main.WebHome (ntopics=1..prev=1, 2, next=3, numberofpages=3, pagesize=5..)ntopics=1 
     
    40724800Sandbox.WebHome (ntopics=2..prev=1, 2, next=3, numberofpages=3, pagesize=5..)ntopics=2 
    40734801FOOT(2,2)(ntopics=2..prev=1, 2, next=3, numberofpages=3, pagesize=5..) 
    4074 EXPECT 
     4802FOSWIKI11 
     4803 
    40754804    $expected =~ s/\n$//s; 
    40764805    $this->assert_str_equals( $expected, $result ); 
    40774806 
    4078 } 
    4079  
    4080 sub verify_simple_format { 
     4807    return; 
     4808} 
     4809 
     4810sub test_simple_format { 
    40814811    my $this = shift; 
    40824812 
     
    40924822' 
    40934823    ); 
    4094     my $expected = <<'HERE'; 
     4824    my $expected = $this->_expect_with_deps( 
     4825        <<'FOSWIKI12', 
     4826   * !Main.WebHome 
     4827   * !Main.WebPreferences 
     4828   * !Main.WebTopicList 
     4829<div class="foswikiSearchResultCount">Number of topics: <span>3</span></div> 
     4830   * !Sandbox.WebHome 
     4831   * !Sandbox.WebPreferences 
     4832   * !Sandbox.WebTopicList 
     4833<div class="foswikiSearchResultCount">Number of topics: <span>3</span></div> 
     4834   * !System.WebHome 
     4835   * !System.WebPreferences 
     4836   * !System.WebTopicList 
     4837<div class="foswikiSearchResultCount">Number of topics: <span>3</span></div> 
     4838   * !TestCases.WebHome 
     4839   * !TestCases.WebPreferences 
     4840   * !TestCases.WebTopicList 
     4841<div class="foswikiSearchResultCount">Number of topics: <span>3</span></div> 
     4842FOSWIKI12 
     4843        'Foswiki,<,1.2' => <<'FOSWIKI11'); 
    40954844   * !TestCases.WebHome 
    40964845   * !TestCases.WebPreferences 
     
    41094858   * !Sandbox.WebTopicList 
    41104859<div class="foswikiSearchResultCount">Number of topics: <span>3</span></div> 
    4111 HERE 
     4860FOSWIKI11 
    41124861 
    41134862    $this->assert_str_equals( $expected, $actual ); 
    4114 } 
    4115  
    4116 sub verify_formatdotBang { 
     4863 
     4864    return; 
     4865} 
     4866 
     4867sub test_formatdotBang { 
    41174868    my $this = shift; 
    41184869 
     
    41364887 
    41374888    $this->assert_str_equals( $expected, $actual ); 
    4138 } 
    4139  
    4140 sub verify_delayed_expansion { 
    4141     my $this = shift; 
    4142     eval "require Foswiki::Macros::SEARCH"; 
     4889 
     4890    return; 
     4891} 
     4892 
     4893sub test_delayed_expansion { 
     4894    my $this = shift; 
     4895    $this->assert( eval { require Foswiki::Macros::SEARCH; 1; } 
     4896          and not $EVAL_ERROR ); 
    41434897 
    41444898    my $result = $Foswiki::Plugins::SESSION->SEARCH( 
     
    41544908        $this->{test_topicObject} 
    41554909    ); 
    4156     $this->assert_str_equals( <<EXPECT, $result . "\n" ); 
     4910    $this->assert_str_equals( <<'EXPECT', $result . "\n" ); 
    41574911WebHome, WebIndex, WebPreferences, WebHome, WebIndex, WebPreferences 
    41584912EXPECT 
     
    41704924        $this->{test_topicObject} 
    41714925    ); 
    4172     $this->assert_str_equals( <<EXPECT, $result . "\n" ); 
     4926    $this->assert_str_equals( <<'EXPECT', $result . "\n" ); 
    41734927%WIKINAME%, %WIKINAME%, %WIKINAME%, %WIKINAME%, %WIKINAME%, %WIKINAME% 
    41744928EXPECT 
     
    41894943        $this->{test_topicObject} 
    41904944    ); 
    4191     $this->assert_str_equals( <<EXPECT, $result . "\n" ); 
     4945    $this->assert_str_equals( <<'EXPECT', $result . "\n" ); 
    41924946%INCLUDE{Main.WebHeader}%WebHome, WebIndex, WebPreferences%INCLUDE{Main.WebFooter}%%INCLUDE{Main.WebHeader}%WebHome, WebIndex, WebPreferences%INCLUDE{Main.WebFooter}% 
    41934947EXPECT 
    41944948 
     4949    return; 
    41954950} 
    41964951 
     
    42214976#    $this->{twiki}->{store}->saveTopic( 'simon', 
    42224977#        $this->{test_web}, 'QueryTopic', $text, undef, {forcedate=>1178612772} ); 
    4223     my $topicObject = 
    4224       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'QueryTopic', 
    4225         $text ); 
    4226     $topicObject->save( forcedate => 1178612772, author => 'simon' ); 
     4978    my ($topicObject) = 
     4979      Foswiki::Func::readTopic( $this->{test_web}, 'QueryTopic' ); 
     4980    $topicObject->text($text); 
     4981    $topicObject->save( 
     4982        forcedate        => 1178412772, 
     4983        author           => 'admin', 
     4984        forcenewrevision => 1 
     4985    ); 
     4986    $topicObject->save( 
     4987        forcedate        => 1178612772, 
     4988        author           => 'simon', 
     4989        forcenewrevision => 1 
     4990    ); 
     4991    $topicObject->finish(); 
    42274992 
    42284993    $text = <<'HERE'; 
    4229 %META:TOPICINFO{author="BaseUserMapping_666" date="12" format="1.1" version="1.2"}% 
     4994%META:TOPICINFO{author="BaseUserMapping_666" date="1108412772" format="1.1" version="1.2"}% 
    42304995first line 
    42314996This is QueryTopicTwo SMONG 
     
    42475012    #$this->{twiki}->{store}->saveTopic( 'admin', 
    42485013    #    $this->{test_web}, 'QueryTopicTwo', $text, undef, {forcedate=>12} ); 
    4249     $topicObject = 
    4250       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'QueryTopicTwo', 
    4251         $text ); 
    4252     $topicObject->save( forcedate => 12, author => 'admin' ); 
     5014    ($topicObject) = 
     5015      Foswiki::Func::readTopic( $this->{test_web}, 'QueryTopicTwo' ); 
     5016    $topicObject->text($text); 
     5017    $topicObject->save( 
     5018        forcedate        => 1108312772, 
     5019        author           => 'admin', 
     5020        forcenewrevision => 1 
     5021    ); 
     5022    $topicObject->save( 
     5023        forcedate        => 1178612772, 
     5024        author           => 'simon', 
     5025        forcenewrevision => 1 
     5026    ); 
     5027    $topicObject->finish(); 
    42535028 
    42545029    $text = <<'HERE'; 
    4255 %META:TOPICINFO{author="TopicUserMapping_Gerald" date="14" format="1.1" version="1.2"}% 
     5030%META:TOPICINFO{author="TopicUserMapping_Gerald" date="1108412782" format="1.1" version="1.2"}% 
    42565031first line 
    42575032This is QueryTopicThree SMONG 
     
    42735048    #$this->{twiki}->{store}->saveTopic( 'Gerald', 
    42745049    #    $this->{test_web}, 'QueryTopicThree', $text, undef, {forcedate=>14} ); 
    4275     $topicObject = 
    4276       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 
    4277         'QueryTopicThree', $text ); 
    4278     $topicObject->save( forcedate => 14, author => 'Gerald' ); 
    4279  
    4280     $this->{session}->finish(); 
    4281     my $query = new Unit::Request(""); 
     5050    ($topicObject) = 
     5051      Foswiki::Func::readTopic( $this->{test_web}, 'QueryTopicThree' ); 
     5052    $topicObject->text($text); 
     5053    $topicObject->save( forcedate => 1108413782, author => 'Gerald' ); 
     5054    $topicObject->finish(); 
     5055 
     5056    my $query = Unit::Request->new(''); 
    42825057    $query->path_info("/$this->{test_web}/$this->{test_topic}"); 
    42835058 
    4284     $this->{session} = new Foswiki( undef, $query ); 
     5059    $this->createNewFoswikiSession( undef, $query ); 
    42855060    $this->assert_str_equals( $this->{test_web}, $this->{session}->{webName} ); 
    4286     $Foswiki::Plugins::SESSION = $this->{session}; 
    4287  
    4288     $this->{test_topicObject} = 
    4289       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 
    4290         $this->{test_topic} ); 
    4291 } 
    4292  
    4293 sub verify_orderTopic { 
     5061 
     5062    return; 
     5063} 
     5064 
     5065sub test_orderTopic { 
    42945066    my $this = shift; 
    42955067 
     
    43245096    ); 
    43255097 
    4326 #order=created 
    4327 #TODO: looks like forcedate is broken? so the date tests are unlikely to have enough difference to order. 
    4328     $result = 
    4329       $this->{test_topicObject}->expandMacros( 
    4330         $search . 'order="created" format="$topic ($createdate)"}%' ); 
    4331  
    4332 #$this->assert_str_equals( "OkATopic,OkBTopic,OkTopic,QueryTopic,QueryTopicThree,QueryTopicTwo,TestTopicSEARCH,WebPreferences", $result ); 
     5098    #order=created 
     5099    $result = 
     5100      $this->{test_topicObject} 
     5101      ->expandMacros( $search . 'order="created" format="$topic"}%' ); 
     5102 
     5103    $this->assert_str_equals( 
     5104"QueryTopicTwo,QueryTopicThree,QueryTopic,WebPreferences,TestTopicSEARCH,OkTopic,OkATopic,OkBTopic", 
     5105        $result 
     5106    ); 
    43335107 
    43345108    $result = 
     
    43365110      ->expandMacros( $search . 'order="created" reverse="on"}%' ); 
    43375111 
    4338 #$this->assert_str_equals( "WebPreferences,TestTopicSEARCH,QueryTopicTwo,QueryTopicThree,QueryTopic,OkTopic,OkBTopic,OkATopic", $result ); 
     5112    $this->assert_str_equals( 
     5113"OkBTopic,OkATopic,OkTopic,TestTopicSEARCH,WebPreferences,QueryTopic,QueryTopicThree,QueryTopicTwo", 
     5114        $result 
     5115    ); 
    43395116 
    43405117    #order=modified 
     
    43425119      $this->{test_topicObject}->expandMacros( $search . 'order="modified"}%' ); 
    43435120 
    4344 #$this->assert_str_equals( "OkATopic,OkBTopic,OkTopic,QueryTopic,QueryTopicThree,QueryTopicTwo,TestTopicSEARCH,WebPreferences", $result ); 
    4345  
    4346     $result = 
    4347       $this->{test_topicObject} 
    4348       ->expandMacros( $search . 'order="modified" reverse="on"}%' ); 
    4349  
    4350 #$this->assert_str_equals( "WebPreferences,TestTopicSEARCH,QueryTopicTwo,QueryTopicThree,QueryTopic,OkTopic,OkBTopic,OkATopic", $result ); 
     5121    $this->assert_str_equals( 
     5122"QueryTopicThree,QueryTopicTwo,QueryTopic,WebPreferences,TestTopicSEARCH,OkTopic,OkATopic,OkBTopic", 
     5123        $result 
     5124    ); 
     5125 
     5126    $result = 
     5127      $this->{test_topicObject}->expandMacros( 
     5128        $search . 'order="modified" reverse="on" format="$topic"}%' ); 
     5129 
     5130#be very careful with this test and the one above - the change in order between QueryTopicTwo,QueryTopic is due to them having the same date, so its sorting by topicname 
     5131    $this->assert_str_equals( 
     5132"OkBTopic,OkATopic,OkTopic,TestTopicSEARCH,WebPreferences,QueryTopicTwo,QueryTopic,QueryTopicThree", 
     5133        $result 
     5134    ); 
    43515135 
    43525136    #order=editby 
     
    43575141 
    43585142#    $this->assert_str_equals( "QueryTopicThree (Gerald),OkATopic (WikiGuest),OkBTopic (WikiGuest),OkTopic (WikiGuest),TestTopicSEARCH (WikiGuest),WebPreferences (WikiGuest),QueryTopicTwo (admin),QueryTopic (simon)", $result ); 
    4359     $this->assert_str_equals( 
    4360 "QueryTopicThree (Gerald),OkTopic (WikiGuest),OkBTopic (WikiGuest),WebPreferences (WikiGuest),TestTopicSEARCH (WikiGuest),OkATopic (WikiGuest),QueryTopicTwo (admin),QueryTopic (simon)", 
     5143#    $this->assert_str_equals( 
     5144#"QueryTopicThree (Gerald),OkTopic (WikiGuest),OkBTopic (WikiGuest),WebPreferences (WikiGuest),TestTopicSEARCH (WikiGuest),OkATopic (WikiGuest),QueryTopicTwo (admin),QueryTopic (simon)", 
     5145#        $result 
     5146#    ); 
     5147#needed to allow for store based differences in non-specified fields (ie, if sort on editby, then topic order is random - dependent on store impl) 
     5148    $this->assert_matches( 
     5149qr/^QueryTopicThree \(Gerald\),.*WikiGuest\),QueryTopicTwo \(simon\),QueryTopic \(simon\)$/, 
    43615150        $result 
    43625151    ); 
     
    43695158 
    43705159#    $this->assert_str_equals( "QueryTopic (simon),QueryTopicTwo (admin),OkATopic (WikiGuest),OkBTopic (WikiGuest),OkTopic (WikiGuest),TestTopicSEARCH (WikiGuest),WebPreferences (WikiGuest),QueryTopicThree (Gerald)", $result ); 
    4371     $this->assert_str_equals( 
    4372 "QueryTopic (simon),QueryTopicTwo (admin),OkTopic (WikiGuest),OkBTopic (WikiGuest),WebPreferences (WikiGuest),TestTopicSEARCH (WikiGuest),OkATopic (WikiGuest),QueryTopicThree (Gerald)", 
     5160#    $this->assert_str_equals( 
     5161#"QueryTopic (simon),QueryTopicTwo (admin),OkTopic (WikiGuest),OkBTopic (WikiGuest),WebPreferences (WikiGuest),TestTopicSEARCH (WikiGuest),OkATopic (WikiGuest),QueryTopicThree (Gerald)", 
     5162#        $result 
     5163#    ); 
     5164#needed to allow for store based differences in non-specified fields (ie, if sort on editby, then topic order is random - dependent on store impl) 
     5165    $this->assert_matches( 
     5166qr/^QueryTopicTwo \(simon\),QueryTopic \(simon\),.*\(WikiGuest\),QueryTopicThree \(Gerald\)$/, 
    43735167        $result 
    43745168    ); 
     
    43835177 
    43845178#$this->assert_str_equals( "OkATopic (),OkBTopic (),OkTopic (),TestTopicSEARCH (),WebPreferences (),QueryTopicThree (2),QueryTopicTwo (7),QueryTopic (1234)", $result ); 
    4385     $this->assert_str_equals( 
    4386 "OkTopic (),OkBTopic (),WebPreferences (),TestTopicSEARCH (),OkATopic (),QueryTopicThree (2),QueryTopicTwo (7),QueryTopic (1234)", 
     5179#    $this->assert_str_equals( 
     5180#"OkTopic (),OkBTopic (),WebPreferences (),TestTopicSEARCH (),OkATopic (),QueryTopicThree (2),QueryTopicTwo (7),QueryTopic (1234)", 
     5181#        $result 
     5182#    ); 
     5183    $this->assert_matches( 
     5184        qr/\(\),QueryTopicThree \(2\),QueryTopicTwo \(7\),QueryTopic \(1234\)$/, 
    43875185        $result 
    43885186    ); 
     
    44885286    ); 
    44895287 
     5288    return; 
     5289} 
     5290 
     5291sub verify_bad_order { 
     5292    my $this = shift; 
     5293 
     5294    $this->set_up_for_sorting(); 
     5295    my $search = 
     5296        '%SEARCH{".*" type="regex" scope="topic" web="' 
     5297      . $this->{test_web} 
     5298      . '" format="$topic" separator="," nonoise="on" '; 
     5299    my $result = 
     5300      $this->{test_topicObject} 
     5301      ->expandMacros( $search . 'order="formfield()"}%' ); 
     5302 
     5303    # Should get the default search order (or an error message, perhaps?) 
     5304    $this->assert_str_equals( 
     5305"OkATopic,OkBTopic,OkTopic,QueryTopic,QueryTopicThree,QueryTopicTwo,TestTopicSEARCH,WebPreferences", 
     5306        $result 
     5307    ); 
     5308 
     5309    return; 
    44905310} 
    44915311 
     
    45015321    ); 
    45025322 
    4503     $this->assert_str_equals( '$web=TemporarySEARCHTestWebSEARCH', $result ); 
     5323    $this->assert_str_equals( "\$web=$this->{test_web}", $result ); 
    45045324 
    45055325    $result = $this->{test_topicObject}->expandMacros( 
     
    45155335 
    45165336    $this->assert_str_equals( 
    4517         'header: $web=TemporarySEARCHTestWebSEARCH<br /> 
    4518 format: $web=TemporarySEARCHTestWebSEARCH<br /> 
    4519 footer: $web=TemporarySEARCHTestWebSEARCH', $result 
     5337        "header: \$web=$this->{test_web}<br /> 
     5338format: \$web=$this->{test_web}<br /> 
     5339footer: \$web=$this->{test_web}", $result 
    45205340    ); 
    45215341 
     
    45325352 
    45335353    $this->assert_str_equals( 
    4534         '   1 OkATopic 
     5354        "   1 OkATopic 
    45355355   1 OkBTopic 
    45365356   1 OkTopic 
    45375357   1 TestTopicSEARCH 
    45385358   1 WebPreferences 
    4539 pagerformat: $web=TemporarySEARCHTestWebSEARCH', $result 
    4540     ); 
     5359pagerformat: \$web=$this->{test_web}", $result 
     5360    ); 
     5361 
     5362    return; 
    45415363} 
    45425364 
     
    45555377 
    45565378    $this->assert_matches( qr/^FOO /, $result ); 
     5379 
     5380    return; 
    45575381} 
    45585382 
     
    45735397%META:FIELD{name="Option" attributes="" title="Some option" value="Some long test I can truncate later"}% 
    45745398METADATA 
    4575     my $topicObject = 
    4576       Foswiki::Meta->new( $this->{session}, $this->{test_web}, $testTopic, 
    4577         "---++ $header\n$body\n$meta\n" ); 
     5399    my ($topicObject) = 
     5400      Foswiki::Func::readTopic( $this->{test_web}, $testTopic ); 
     5401    $topicObject->text("---++ $header\n$body\n$meta\n"); 
    45785402    $topicObject->save(); 
    45795403 
     
    46465470        '$summary(noheader)' => qr/^\* Set ${nop}POTLEADER = ${nop}ScumBag$/, 
    46475471        '$pattern(.*?POTLEADER *= *([^\n]*).*)' => 'ScumBag', 
    4648         '$count(.*S.*)' => 2,    # Headers are not matched 
     5472        '$count(.*S.*)'                         => 2,          # Not sure why... 
    46495473    ); 
    46505474    while ( my ( $token, $expected ) = each %testFormatTokens ) { 
     
    46625486              . "Expected:'$expected'\n But got:'$result'\n" ); 
    46635487    } 
     5488    $topicObject->finish(); 
    46645489 
    46655490    return; 
     
    46765501 
    46775502    Foswiki::Func::createWeb($testWeb); 
    4678     my $topicObject = 
    4679       Foswiki::Meta->new( $this->{session}, $testWeb, $testTopic, 
    4680         "begin $body end\n" ); 
     5503    my ($topicObject) = Foswiki::Func::readTopic( $testWeb, $testTopic ); 
     5504    $topicObject->text("begin $body end\n"); 
    46815505    $topicObject->save(); 
    46825506    my $expected     = $topicObject->expandMacros($body); 
     
    47015525            "Expansion of SEARCH failed remotely (expandvariables=\"off\")!\n" 
    47025526          . "Expected:'$expectedFail'\n But got:'$result'\n" ); 
     5527    $topicObject->finish(); 
    47035528    return; 
    47045529} 
     
    47235548    my $this = shift; 
    47245549 
    4725     my $topicObject = 
    4726       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'VirtualBeer', 
    4727         "There are alot of Virtual Beers to go around" ); 
     5550    my ($topicObject) = 
     5551      Foswiki::Func::readTopic( $this->{test_web}, 'VirtualBeer' ); 
     5552    $topicObject->text("There are alot of Virtual Beers to go around"); 
    47285553    $topicObject->save(); 
    4729     $topicObject = 
    4730       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'RealBeer', 
    4731         "There are alot of Virtual Beer to go around" ); 
     5554    $topicObject->finish(); 
     5555    ($topicObject) = Foswiki::Func::readTopic( $this->{test_web}, 'RealBeer' ); 
     5556    $topicObject->text("There are alot of Virtual Beer to go around"); 
    47325557    $topicObject->save(); 
    4733     $topicObject = 
    4734       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'FamouslyBeered', 
    4735         "Virtually speaking there could be alot of famous Beers" ); 
     5558    $topicObject->finish(); 
     5559    ($topicObject) = 
     5560      Foswiki::Func::readTopic( $this->{test_web}, 'FamouslyBeered' ); 
     5561    $topicObject->text( 
     5562        "Virtually speaking there could be alot of famous Beers"); 
    47365563    $topicObject->save(); 
    4737     $topicObject = 
    4738       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'VirtualLife', 
    4739         "In a all life, I would expect to find fine Beer" ); 
     5564    $topicObject->finish(); 
     5565    ($topicObject) = 
     5566      Foswiki::Func::readTopic( $this->{test_web}, 'VirtualLife' ); 
     5567    $topicObject->text("In a all life, I would expect to find fine Beer"); 
    47405568    $topicObject->save(); 
    4741     $topicObject = 
    4742       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'NoLife', 
    4743         "In a all life, I would expect to find fine Beer" ); 
     5569    $topicObject->finish(); 
     5570    ($topicObject) = Foswiki::Func::readTopic( $this->{test_web}, 'NoLife' ); 
     5571    $topicObject->text("In a all life, I would expect to find fine Beer"); 
    47445572    $topicObject->save(); 
    4745     $topicObject = 
    4746       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'NoBeer', 
    4747         "In a all life, I would expect to find fine Beer" ); 
     5573    $topicObject->finish(); 
     5574    ($topicObject) = Foswiki::Func::readTopic( $this->{test_web}, 'NoBeer' ); 
     5575    $topicObject->text("In a all life, I would expect to find fine Beer"); 
    47485576    $topicObject->save(); 
    4749     $topicObject = 
    4750       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'SomeBeer', 
    4751         "In a all life, I would expect to find fine Wine" ); 
     5577    $topicObject->finish(); 
     5578    ($topicObject) = Foswiki::Func::readTopic( $this->{test_web}, 'SomeBeer' ); 
     5579    $topicObject->text("In a all life, I would expect to find fine Wine"); 
    47525580    $topicObject->save(); 
     5581    $topicObject->finish(); 
    47535582 
    47545583    my $result = 
     
    48155644} 
    48165645 
    4817 #TaxonProfile/Builder.TermForm 
     5646#Profile/Builder.TermForm 
    48185647sub verify_Item10269 { 
    48195648    my $this = shift; 
     
    48235652    my $result = 
    48245653      $this->{test_topicObject}->expandMacros( 
    4825         '%SEARCH{"NewField=\'TaxonProfile/Builder.TermForm\'"' . $stdCrap ); 
     5654        '%SEARCH{"NewField=\'Profile/Builder.TermForm\'"' . $stdCrap ); 
    48265655    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
     5656 
     5657    return; 
     5658} 
     5659 
     5660#Profile/Builder.TermForm 
     5661sub verify_Item10398 { 
     5662    my $this = shift; 
     5663 
     5664    $this->set_up_for_queries(); 
     5665 
     5666    my ($topicObject) = 
     5667      Foswiki::Func::readTopic( $this->{test_web}, 'Trash.MainBobTest' ); 
     5668    $topicObject->text("BLEEGLE blah/matchme.blah"); 
     5669    $topicObject->save(); 
     5670    $topicObject->finish(); 
     5671 
     5672    my $result = 
     5673      $this->{test_topicObject} 
     5674      ->expandMacros( '%SEARCH{"name=\'WebPreferences\'" type="query" web="' 
     5675          . $this->{test_web} 
     5676          . '" recurse="on" nonoise="on" format="$topic"}%' ); 
     5677    $this->assert_str_equals( 'WebPreferences', $result ); 
     5678 
     5679    return; 
     5680} 
     5681 
     5682#Item10515 
     5683sub verify_lhs_lc_field_rhs_lc_string { 
     5684    my $this = shift; 
     5685 
     5686    $this->set_up_for_queries(); 
     5687 
     5688    my $result = 
     5689      $this->{test_topicObject} 
     5690      ->expandMacros( '%SEARCH{"lc(Firstname)=lc(\'JOHN\')"' . $stdCrap ); 
     5691    $this->assert_str_equals( 'QueryTopicTwo', $result ); 
     5692 
     5693    return; 
    48275694} 
    48285695 
     
    48335700    #$this->set_up_for_queries(); 
    48345701 
    4835     my $topicObject = 
    4836       Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'Item10491', 
    4837         <<TOPICTEXT ); 
     5702    my ($topicObject) = 
     5703      Foswiki::Func::readTopic( $this->{test_web}, 'Item10491' ); 
     5704    $topicObject->text(<<'TOPICTEXT' ); 
    48385705Search on Foswiki.org has been showing some signs of corruption.   The topic Tasks/Item968 appeared to be related, however it can be created  From IRC: 
    48395706 
     
    48835750TOPICTEXT 
    48845751    $topicObject->save(); 
     5752    $topicObject->finish(); 
    48855753 
    48865754    my $result = 
     
    48905758          . '"  scope="all" order="topic"}%' ); 
    48915759    $this->assert_str_equals( 
    4892         _cut_the_crap(<<RESULT), _cut_the_crap( $result . "\n" ) ); 
     5760        _cut_the_crap(<<"RESULT"), _cut_the_crap( $result . "\n" ) ); 
    48935761<div class="foswikiSearchResultsHeader"><span>Searched: <b><noautolink>SomeString</noautolink></b></span><span id="foswikiNumberOfResultsContainer"></span></div> 
    4894 <h4 class="foswikiSearchResultsHeader"  style="border-color:\#FF00FF"><b>Results from <nop>TemporarySEARCHTestWebSEARCH web</b> retrieved at 04:34 (GMT)</h4> 
     5762<h4 class="foswikiSearchResultsHeader"  style="border-color:#FF00FF"><b>Results from <nop>$this->{test_web} web</b> retrieved at 04:34 (GMT)</h4> 
    48955763<div class="foswikiSearchResult"><div class="foswikiTopRow"> 
    4896 <a href="/~sven/core/bin/view/TemporarySEARCHTestWebSEARCH/Item10491"><b>Item10491</b></a> 
     5764<a href="/~sven/core/bin/view/$this->{test_web}/Item10491"><b>Item10491</b></a> 
    48975765<div class="foswikiSummary"><b>&hellip;</b> it can be created From <nop>IRC<nop>: <em><nop>SomeString</em>.txt So hopefully this topic  <b>&hellip;</b>  hits don't get corrupted. <em><nop>SomeString</em>? " txt<nop>: <nop>SomeString? And  <b>&hellip;</b> ?tab=searchadvanced search=<em><nop>SomeString</em> scope=all order=topic type= <b>&hellip;</b> </div></div> 
    4898 <div class="foswikiBottomRow"><span class="foswikiSRRev"><span class="foswikiNew">NEW</span> - <a href="/~sven/core/bin/rdiff/TemporarySEARCHTestWebSEARCH/Item10491" rel='nofollow'>16 Mar 2011 - 04:34</a></span> <span class="foswikiSRAuthor">by WikiGuest </span></div> 
     5766<div class="foswikiBottomRow"><span class="foswikiSRRev"><span class="foswikiNew">NEW</span> - <a href="/~sven/core/bin/rdiff/$this->{test_web}/Item10491" rel='nofollow'>16 Mar 2011 - 04:34</a></span> <span class="foswikiSRAuthor">by WikiGuest </span></div> 
    48995767</div> 
    49005768<div class="foswikiSearchResultCount">Number of topics: <span>1</span></div> 
    49015769RESULT 
     5770 
     5771    return; 
    49025772} 
    49035773 
     
    49165786        $result 
    49175787    ); 
     5788 
     5789    return; 
     5790} 
     5791 
     5792sub verify_crossweb_op_ref { 
     5793    my $this   = shift; 
     5794    my %topics = ( 
     5795        "$this->{test_web}/LLB/Analyses/Sequences.00001" => <<"HERE", 
     5796%META:TOPICINFO{author="BaseUserMapping_333" date="1313039642" format="1.1" version="1"}% 
     5797%META:TOPICPARENT{name="All"}% 
     5798 
     5799%META:FORM{name="Profile/Definitions.Acacia_Sequence_Form"}% 
     5800%META:FIELD{name="Acacia_TraceSet" title="TraceSet" type="llb+input" value="$this->{test_web}/LLB/Results/TraceSets.00001"}% 
     5801%META:FIELD{name="Acacia_WorkState" title="Editing" type="list+one" value="done"}% 
     5802%META:FIELD{name="Acacia_Complete" title="Complete" type="boolean" value="1"}% 
     5803%META:FIELD{name="Acacia_DateCompleted" title="Date completed" type="date" value=""}% 
     5804%META:FIELD{name="Acacia_GenbankNumber" title="Genbank number" type="text" value="AF523110"}% 
     5805%META:FIELD{name="Acacia_GenbankLink" title="Genbank Link" type="text" value="http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=nucleotide&val=22725481"}% 
     5806%META:FIELD{name="Acacia_SequenceNotes" title="Notes" type="richtext" value=""}% 
     5807%META:FIELD{name="Acacia_Sequence" title="Sequence" type="llb+sequence" value="TCGGCTTTTAAGTGCGACTCAAAATTTTACACATTTCTATGAAGCAATGGATTCATCCATACCATCGGTAGAGTTTGTAAGACCACGACTGATCCAGAAAGGAATGAATGGAAAAAGCAGCATGTCGTATCAATGGAGAATTCTAAGACTATCTCATTTTTATTGGATCGGGCCCAAATCCATGTTTGTATTCTTGGCTCGCAACAAAAGCAAAAGAAATTCACAGTTGGGTTGAATTAATAAATGGATAGAGTTTGGTGACTCCAATTATAGGGAAACAAAAAGGAACGAGCTTTTGTTTTGAATTTGAATGATTCCCCCATCTAATTATACGTTAAAAATATAAAATATTAGTACTTGATGGGGGAAAAGCTTTTCCCATGAATGGATTATTGATTTTTGTTATGAATCCTAACTATTAGCTATTCTCCATTATAATTAGATTATGGGGTGGCGATAAATGTGTAGAAGAAAGAGTATATTGATAAAGATCTTTTTTTTTTTTCCAAAATCAAAAGAGCGATTGGGTTGAGAAAATAAAGGATTTCTAACTATCTTGTTATCCTAGAACGAACATAAAACAATTAGATGGAAAAAGCGAGTAGAGAGAGTCCGTTGATGAGTCTTACTTGTTTTCTAGGTATCTTTTTTTAGAATAGAATACCCTGTTTTGACTGTATCGCACTATGTATTATTTGATAACCCAATAAATCTTCGATCCTCGGCCCAAATCAAATTTCAAAAAATGGAGGAATTTCAAGTATATTTAGAACTAGATAGATCTCGTCAACATGACTTCCTATACCCACTTATTTTTCGGGAGTATATTTTTGCACTTGCTTACGATCATGGTTTAAATAGTTCCATTTTGGTGCAAGATCTAGGTTATGACAATAAATCTAGTTTACTAATTGTAAAACGTTTAATTACTCGAATGTATCACCAGAATCATTTGATTATTTCTGCTAATAATTCTAACAAAAATCCATTTTGGGGGTACAACAAGAATTTGTATTCTCAAATAATATCAGAGGGGCTTGCCGTCAGTGTGGAAATTCCATTTTCCCTACAACTAATCTCTTCCTTAGAGAAGGCAGAAATTATAAAATCCTATAATTTACGATCAATTCATTCAATATTTCCTTTTTTTGAGGAAAAATTTCCATATTTAAATTATGTGTCAGATGTACAAATACCCTACCCTATACATCTGGAAATCTTGATTCAAACCCTTCGATACTGGGTGAAAGATGCCTCCTCCTTTCATTTATTAAGGCTCTTTCTTTATGAGTATTGTAATTGGAATAGTCTTATTACTCCAAAAAAAAGGATTTCTACTTTTTCAAAAAGTAATCCAAGATTTTTCCTGTTCCTATATAATTTTTATGTAGGTGAATACGAATCCATCTTTCTTTTTCTCCGTAACAAATCTTCTTATTTACGATTAACATCTTCTGGAGTCTTTTTTGAACGAATCTATTTCTATGCAAAAATAAAACATTTTGTAGAAGTCTTTGATAAGGATTTTCCGTCCACCCTATGGTTCTTCAAGGACCCTTTCATTCATTATGTTAGATATCAAGGAAAATCCATTCTAGCTTCAAAGAATACGCCCTTTTTGATGAAAAAATGGAAATACTATCTTATCCATTTATGGCAATGTCATTTTTTTGTTTGGTCTCAACCAGGAAAGATCCATATAAACCAATTATCCGAGCATTCATTTTCCTTTTTGGGTTATTTTTCAAATGTGCGGCTAAATCCTTCAGTGGTACGGAGTCAAATGTTGGAAAAGTCATTTATAATGGAAAATCTTATGAAAAAGCTTGATACAATAATTCCAATTATTCCTCTAATTAGATCATTGGCTAAAGCAAATTTTTGTAATGTATTAGGACATCCCATTAGTAAGCCGGTCTGGGCCGATTCATCCGATTTTGATATTATTGAGCGATTTTTGCAGATATGCAGAGATCTCTCTCATTATTACAACGGATCCTCAAAAAAAAAGAGTTTGTATCGAATCAAAAAAAACTTCGGGCTTNNTGGATNAAAACTTTGGNGGGTAACNCCAAAAGTCCNNNCGGGTTTTTTAAAAAANTAGGTTTTNAANTANTGGAANAATTNTTTCANAGGAAAAAAANATTTTTTTTTTNATTTTTTCNANAGNTTTTTTTNCTTTGCNNAAGNTANAAAAAGGCGGNTTTGGGANTTTGAAANTTTTGANTTTCNNCNANGATNTGGGCCATCATGAAAAACNGGNTATCNNACNTTGANAANGGGAACNANCCNTNAATNNGGGAAAGATNAAAAAAAAAAGAATTCATTCGTTTCTATTATGAAATTTCTATTATGAAATATGAAATGGATTATGAAATGCTCATGTAGTAAGAGTAGGAATTGATAAACTAAGNACTTAACTTTTTTAGAGTCCNGTTCTAGGGAAGGAACTGAGGTTTAGATGTATACATAGGGAAAGCCGTGTGCAATGAAAAATGCAAGTACGGCCTGGGGAGGNNTTTTTTT"}% 
     5808HERE 
     5809        "$this->{test_web}/LLB/Analyses/Sequences.00002" => <<"HERE", 
     5810%META:TOPICINFO{author="BaseUserMapping_333" date="1313039642" format="1.1" version="1"}% 
     5811%META:TOPICPARENT{name="All"}% 
     5812 
     5813%META:FORM{name="Profile/Definitions.Acacia_Sequence_Form"}% 
     5814%META:FIELD{name="Acacia_TraceSet" title="TraceSet" type="llb+input" value="$this->{test_web}/LLB/Results/TraceSets.00002"}% 
     5815%META:FIELD{name="Acacia_WorkState" title="Editing" type="list+one" value="done"}% 
     5816%META:FIELD{name="Acacia_Complete" title="Complete" type="boolean" value="1"}% 
     5817%META:FIELD{name="Acacia_DateCompleted" title="Date completed" type="date" value=""}% 
     5818%META:FIELD{name="Acacia_GenbankNumber" title="Genbank number" type="text" value="AF195707"}% 
     5819%META:FIELD{name="Acacia_GenbankLink" title="Genbank Link" type="text" value="http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=nucleotide&val=10880548"}% 
     5820%META:FIELD{name="Acacia_SequenceNotes" title="Notes" type="richtext" value=""}% 
     5821%META:FIELD{name="Acacia_Sequence" title="Sequence" type="llb+sequence" value="AAAATCTTGGTCTTAATGTATACGAGTTTTTGAACGTAAAGGAGCAATAATTAATTTATTGTTCTATCAAGAGGGTTAATATTGCTCCTTTACTTTTTAGTAGTTTCATACATCAATTTTGTATTTACTTCAACATTCTTTACCGTTGTTTTAAGATAAGAAAAAAATATTGGAGTTTCATACTTTTTGTTTCTTTTTTACTAATTTATTTTATACGTTTTTTTCAGCAATCTTTCTTTATCTTTTGAAATGAAAAAAAAAAACAAAAGAAAGAATACAAATATCTCTGTAATTTTTAGATGGTTTTTAGATGGTATAGG"}% 
     5822HERE 
     5823        "$this->{test_web}/LLB/Results/TraceSets.00001" => <<"HERE", 
     5824%META:TOPICINFO{author="BaseUserMapping_333" date="1313040485" format="1.1" version="1"}% 
     5825%META:TOPICPARENT{name="All"}% 
     5826 
     5827%META:FORM{name="Profile/Definitions.Acacia_TraceSet_Form"}% 
     5828%META:FIELD{name="Acacia_PCRProduct" title="PCR Product" type="llb+input" value="$this->{test_web}/LLB/Samples/PCRs.00001"}% 
     5829HERE 
     5830        "$this->{test_web}/LLB/Results/TraceSets.00002" => <<"HERE", 
     5831%META:TOPICINFO{author="BaseUserMapping_333" date="1313040748" format="1.1" version="1"}% 
     5832%META:TOPICPARENT{name="All"}% 
     5833 
     5834%META:FORM{name="Profile/Definitions.Acacia_TraceSet_Form"}% 
     5835%META:FIELD{name="Acacia_PCRProduct" title="PCR Product" type="llb+input" value="$this->{test_web}/LLB/Samples/PCRs.00002"}% 
     5836HERE 
     5837        "$this->{test_web}/LLB/Samples/PCRs.00001" => <<"HERE", 
     5838%META:TOPICINFO{author="BaseUserMapping_333" date="1313038798" format="1.1" version="1"}% 
     5839%META:TOPICPARENT{name="All"}% 
     5840 
     5841%META:FORM{name="Profile/Definitions.Acacia_SamplePCR_Form"}% 
     5842%META:FIELD{name="Acacia_Extract" title="Extract" type="llb+input" value="$this->{test_web}/LLB/Samples/Extracts.0000"}% 
     5843%META:FIELD{name="Acacia_Gene" title="Gene" type="fwaddress" value="$this->{test_web}/LLB/Genes.MatK"}% 
     5844%META:FIELD{name="Acacia_WorkState" title="PCR Done" type="list+one" value="working"}% 
     5845%META:FIELD{name="Acacia_Cleaned" title="PCR Cleaned" type="boolean" value="1"}% 
     5846%META:FIELD{name="Acacia_FreezerLocation" title="Freezer Location" type="text" value=""}% 
     5847HERE 
     5848        "$this->{test_web}/LLB/Samples/PCRs.00002" => <<"HERE", 
     5849%META:TOPICINFO{author="BaseUserMapping_333" date="1313038798" format="1.1" version="1"}% 
     5850%META:TOPICPARENT{name="All"}% 
     5851 
     5852%META:FORM{name="Profile/Definitions.Acacia_SamplePCR_Form"}% 
     5853%META:FIELD{name="Acacia_Extract" title="Extract" type="llb+input" value="$this->{test_web}/LLB/Samples/Extracts.0000"}% 
     5854%META:FIELD{name="Acacia_Gene" title="Gene" type="fwaddress" value="$this->{test_web}/LLB/Genes.PsbA"}% 
     5855%META:FIELD{name="Acacia_WorkState" title="PCR Done" type="list+one" value="done"}% 
     5856%META:FIELD{name="Acacia_Cleaned" title="PCR Cleaned" type="boolean" value="0"}% 
     5857%META:FIELD{name="Acacia_FreezerLocation" title="Freezer Location" type="text" value=""}% 
     5858HERE 
     5859        "$this->{test_web}/LLB/Samples/Extracts.0000" => <<"HERE", 
     5860%META:TOPICINFO{author="BaseUserMapping_333" date="1313038766" format="1.1" version="1"}% 
     5861%META:TOPICPARENT{name="All"}% 
     5862 
     5863%META:FORM{name="Profile/Definitions.Acacia_Extract_Form"}% 
     5864%META:FIELD{name="Acacia_Specimen" title="Specimen" type="llb+input" value="$this->{test_web}/LLB/Materials/Specimens.0120"}% 
     5865%META:FIELD{name="Acacia_ExtractMethod" title="Extraction method" type="text" value="$this->{test_web}/LLB/Methods.10"}% 
     5866%META:FIELD{name="Acacia_TissueType" title="Tissue type" type="list+one" value=""}% 
     5867%META:FIELD{name="Acacia_DNAQuality" title="DNA quality" type="list+one" value="Wig L Bug"}% 
     5868%META:FIELD{name="Acacia_DNAQuality" title="Picture" type="label" value=""}% 
     5869%META:FIELD{name="Acacia_LaneNumber" title="Lane number" type="label" value="7"}% 
     5870%META:FIELD{name="Acacia_PictureInfoFile" title="Picture info file" type="label" value=""}% 
     5871%META:FIELD{name="Acacia_Concentration" title="Concentration (ng/<B5>L)" type="text" value=""}% 
     5872%META:FIELD{name="Acacia_DNANotes" title="DNA Notes" type="text" value=""}% 
     5873%META:FIELD{name="Acacia_FreezerLocation" title="Freezer Location" type="text" value=""}% 
     5874HERE 
     5875        "$this->{test_web}/LLB/Samples/Extracts.0001" => <<"HERE" 
     5876%META:TOPICINFO{author="BaseUserMapping_333" date="1313038766" format="1.1" version="1"}% 
     5877%META:TOPICPARENT{name="All"}% 
     5878 
     5879%META:FORM{name="Profile/Definitions.Acacia_Extract_Form"}% 
     5880%META:FIELD{name="Acacia_Specimen" title="Specimen" type="llb+input" value="$this->{test_web}/LLB/Materials/Specimens.1220"}% 
     5881%META:FIELD{name="Acacia_ExtractMethod" title="Extraction method" type="text" value="$this->{test_web}/LLB/Methods.03"}% 
     5882%META:FIELD{name="Acacia_TissueType" title="Tissue type" type="list+one" value=""}% 
     5883%META:FIELD{name="Acacia_DNAQuality" title="DNA quality" type="list+one" value=""}% 
     5884%META:FIELD{name="Acacia_DNAQuality" title="Picture" type="label" value=""}% 
     5885%META:FIELD{name="Acacia_LaneNumber" title="Lane number" type="label" value="3"}% 
     5886%META:FIELD{name="Acacia_PictureInfoFile" title="Picture info file" type="label" value=""}% 
     5887%META:FIELD{name="Acacia_Concentration" title="Concentration (ng/<B5>L)" type="text" value=""}% 
     5888%META:FIELD{name="Acacia_DNANotes" title="DNA Notes" type="text" value=""}% 
     5889%META:FIELD{name="Acacia_FreezerLocation" title="Freezer Location" type="text" value=""}% 
     5890HERE 
     5891    ); 
     5892    my %tests = ( 
     5893        "Acacia_Specimen='$this->{test_web}/LLB/Materials/Specimens.1220'" => 
     5894          "$this->{test_web}/LLB/Samples/Extracts.0001", 
     5895        "Acacia_Extract/Acacia_ExtractMethod='$this->{test_web}/LLB/Methods.10'" 
     5896          => "$this->{test_web}/LLB/Samples/PCRs.00001, $this->{test_web}/LLB/Samples/PCRs.00002", 
     5897        "Acacia_ExtractMethod='$this->{test_web}/LLB/Methods.03'" => 
     5898          "$this->{test_web}/LLB/Samples/Extracts.0001", 
     5899        "Acacia_Extract/Acacia_ExtractMethod='$this->{test_web}/LLB/Methods.03'" 
     5900          => '', 
     5901        "Acacia_PCRProduct='$this->{test_web}/LLB/Samples/PCRs.00002'" => 
     5902          "$this->{test_web}/LLB/Results/TraceSets.00002", 
     5903"Acacia_PCRProduct/Acacia_Extract/Acacia_ExtractMethod='$this->{test_web}/LLB/Methods.10'" 
     5904          => "$this->{test_web}/LLB/Results/TraceSets.00001, $this->{test_web}/LLB/Results/TraceSets.00002", 
     5905"Acacia_TraceSet/Acacia_PCRProduct/Acacia_Extract/Acacia_ExtractMethod='$this->{test_web}/LLB/Methods.10'" 
     5906          => "$this->{test_web}/LLB/Analyses/Sequences.00001, $this->{test_web}/LLB/Analyses/Sequences.00002", 
     5907        "Acacia_TraceSet/Acacia_PCRProduct/Acacia_WorkState='done'" => 
     5908          "$this->{test_web}/LLB/Analyses/Sequences.00002", 
     5909        "Acacia_TraceSet/Acacia_PCRProduct/Acacia_Cleaned" => 
     5910          "$this->{test_web}/LLB/Analyses/Sequences.00001", 
     5911"form.name='Profile/Definitions.Acacia_Sequence_Form' AND Acacia_TraceSet/Acacia_PCRProduct/Acacia_Extract/Acacia_LaneNumber > 5" 
     5912          => "$this->{test_web}/LLB/Analyses/Sequences.00001, $this->{test_web}/LLB/Analyses/Sequences.00002", 
     5913"form.name='Profile/Definitions.Acacia_Sequence_Form' AND Acacia_TraceSet/Acacia_PCRProduct/Acacia_Extract/Acacia_LaneNumber < 5" 
     5914          => '' 
     5915    ); 
     5916    my $query = Unit::Request->new(''); 
     5917 
     5918    $query->path_info("/$this->{test_web}/$this->{test_topic}"); 
     5919 
     5920    $this->createNewFoswikiSession( $Foswiki::cfg{AdminUserLogin}, $query ); 
     5921    $this->assert_str_equals( $this->{test_web}, $this->{session}->{webName} ); 
     5922    require Foswiki::Address; 
     5923    while ( my ( $fwaddress, $metatext ) = each %topics ) { 
     5924        my $addrObj = Foswiki::Address->new( string => $fwaddress ); 
     5925        my $topicObj; 
     5926 
     5927        if ( not Foswiki::Func::webExists( $addrObj->web() ) ) { 
     5928            my @webs; 
     5929 
     5930            foreach my $part ( @{ $addrObj->webpath() } ) { 
     5931                my $web; 
     5932 
     5933                push( @webs, $part ); 
     5934                $web = join( '/', @webs ); 
     5935                if ( not Foswiki::Func::webExists($web) ) { 
     5936                    Foswiki::Func::createWeb( $web, '_default' ); 
     5937                } 
     5938            } 
     5939        } 
     5940        ($topicObj) = 
     5941          Foswiki::Func::readTopic( $addrObj->web(), $addrObj->topic() ); 
     5942        $topicObj->text($metatext); 
     5943        $topicObj->save(); 
     5944        $topicObj->finish(); 
     5945    } 
     5946    while ( my ( $querysearch, $expected ) = each %tests ) { 
     5947        my $result = 
     5948          $this->_test_query( $querysearch, "$this->{test_web}/LLB" ); 
     5949        $this->assert_str_equals( $expected, $result, 
     5950            "Testing: '$querysearch'\nExpected:'$expected'\nBut got: '$result'" 
     5951        ); 
     5952 
     5953    } 
     5954 
     5955    return; 
     5956} 
     5957 
     5958sub _test_query { 
     5959    my ( $this, $query, $web ) = @_; 
     5960    my $result = $this->{test_topicObject}->expandMacros(<<"HERE"); 
     5961%SEARCH{ 
     5962    "$query" 
     5963    type="query" 
     5964    web="$web" 
     5965    recurse="on" 
     5966    nonoise="on" 
     5967    separator=", " 
     5968    format="\$web.\$topic" 
     5969}% 
     5970HERE 
     5971    chomp($result); 
     5972 
     5973    return $result; 
    49185974} 
    49195975 
Note: See TracChangeset for help on using the changeset viewer.