Skip to content

Commit

Permalink
Item1373: add tests for casesensitive setting - ok on 1.0
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x00@3276 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Mar 26, 2009
1 parent 149682e commit d896972
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions UnitTestContrib/test/unit/Fn_SEARCH.pm
Expand Up @@ -1154,4 +1154,86 @@ Apache is the [[http://www.apache.org/httpd/][well known web server]].

}

sub verify_casesensitivesetting {
my $this = shift;
my $session = $this->{session};

my $actual, my $expected;

$actual =
$this->{twiki}->handleCommonTags(
'%SEARCH{"BLEEGLE" type="regex" multiple="on" casesensitive="on" nosearch="on" noheader="on" nototal="on" format="<nop>$topic" separator=","}%',
$this->{test_web}, $this->{test_topic}
);
#$actual = $this->{test_topicObject}->renderTML($actual);
$expected = '<nop>Ok+Topic,<nop>Ok-Topic,<nop>OkTopic,<nop>TestTopicSEARCH';
$this->assert_str_equals( $expected, $actual );

$actual =
$this->{twiki}->handleCommonTags(
'%SEARCH{"bleegle" type="regex" multiple="on" casesensitive="on" nosearch="on" noheader="on" nototal="on" format="<nop>$topic" separator=","}%',
$this->{test_web}, $this->{test_topic}
);
#$actual = $this->{test_topicObject}->renderTML($actual);
$expected = '';
$this->assert_str_equals( $expected, $actual );

$actual =
$this->{twiki}->handleCommonTags(
'%SEARCH{"BLEEGLE" type="regex" multiple="on" casesensitive="off" nosearch="on" noheader="on" nototal="on" format="<nop>$topic" separator=","}%',
$this->{test_web}, $this->{test_topic}
);
#$actual = $this->{test_topicObject}->renderTML($actual);
$expected = '<nop>Ok+Topic,<nop>Ok-Topic,<nop>OkTopic,<nop>TestTopicSEARCH';
$this->assert_str_equals( $expected, $actual );

$actual =
$this->{twiki}->handleCommonTags(
'%SEARCH{"bleegle" type="regex" multiple="on" casesensitive="off" nosearch="on" noheader="on" nototal="on" format="<nop>$topic" separator=","}%',
$this->{test_web}, $this->{test_topic}
);
#$actual = $this->{test_topicObject}->renderTML($actual);
$expected = '<nop>Ok+Topic,<nop>Ok-Topic,<nop>OkTopic,<nop>TestTopicSEARCH';
$this->assert_str_equals( $expected, $actual );

#topic scope
$actual =
$this->{twiki}->handleCommonTags(
'%SEARCH{"Ok" type="regex" scope="topic" multiple="on" casesensitive="on" nosearch="on" noheader="on" nototal="on" format="<nop>$topic" separator=","}%',
$this->{test_web}, $this->{test_topic}
);
#$actual = $this->{test_topicObject}->renderTML($actual);
$expected = '<nop>Ok+Topic,<nop>Ok-Topic,<nop>OkTopic';
$this->assert_str_equals( $expected, $actual );

$actual =
$this->{twiki}->handleCommonTags(
'%SEARCH{"ok" type="regex" scope="topic" multiple="on" casesensitive="on" nosearch="on" noheader="on" nototal="on" format="<nop>$topic" separator=","}%',
$this->{test_web}, $this->{test_topic}
);
#$actual = $this->{test_topicObject}->renderTML($actual);
$expected = '';
$this->assert_str_equals( $expected, $actual );

$actual =
$this->{twiki}->handleCommonTags(
'%SEARCH{"Ok" type="regex" scope="topic" multiple="on" casesensitive="off" nosearch="on" noheader="on" nototal="on" format="<nop>$topic" separator=","}%',
$this->{test_web}, $this->{test_topic}
);
#$actual = $this->{test_topicObject}->renderTML($actual);
$expected = '<nop>Ok+Topic,<nop>Ok-Topic,<nop>OkTopic';
$this->assert_str_equals( $expected, $actual );

$actual =
$this->{twiki}->handleCommonTags(
'%SEARCH{"ok" type="regex" scope="topic" multiple="on" casesensitive="off" nosearch="on" noheader="on" nototal="on" format="<nop>$topic" separator=","}%',
$this->{test_web}, $this->{test_topic}
);
#$actual = $this->{test_topicObject}->renderTML($actual);
$expected = '<nop>Ok+Topic,<nop>Ok-Topic,<nop>OkTopic';
$this->assert_str_equals( $expected, $actual );

}


1;

0 comments on commit d896972

Please sign in to comment.