Skip to content

Commit

Permalink
Item10484: Add unit tests
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@11057 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed Mar 14, 2011
1 parent 434f106 commit a245096
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions UnitTestContrib/test/unit/Fn_SEARCH.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1368,6 +1368,42 @@ sub verify_refQuery {
$this->assert_str_equals( 'QueryTopicTwo', $result );
}

sub verify_lc_field_short {
my $this = shift;

$this->set_up_for_queries();

my $result =
$this->{test_topicObject}->expandMacros(
'%SEARCH{"lc(Firstname) ~ lc(\'Emma\')"'
. $stdCrap );
$this->assert_str_equals( 'QueryTopic', $result );
}

sub verify_lc_field_qualified {
my $this = shift;

$this->set_up_for_queries();

my $result =
$this->{test_topicObject}->expandMacros(
'%SEARCH{"lc(TestForm.Firstname) ~ lc(\'Emma\')"'
. $stdCrap );
$this->assert_str_equals( 'QueryTopic', $result );
}

sub verify_lc_field_fully_qualified {
my $this = shift;

$this->set_up_for_queries();

my $result =
$this->{test_topicObject}->expandMacros(
'%SEARCH{"lc(TestForm[name=\'Firstname\'].value) ~ lc(\'Emma\')"'
. $stdCrap );
$this->assert_str_equals( 'QueryTopic', $result );
}

# make sure syntax errors are handled cleanly. All the error cases thrown by
# the infix parser are tested more thoroughly in Fn_IF, and don't have to
# be re-tested here.
Expand Down

0 comments on commit a245096

Please sign in to comment.