Skip to content

Commit

Permalink
Item1339: quotemeta test
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@4182 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Jun 17, 2009
1 parent fecd619 commit c19bd4f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions UnitTestContrib/test/unit/Fn_SEARCH.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,34 @@ FORM

}

sub verify_quotemeta {
my $this = shift;

my $topicObject =
Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'TestForm',
<<'FORM');
| *Name* | *Type* | *Size* | *Value* | *Tooltip message* | *Attributes* |
| Why | text | 32 | | Mandatory field | M |
| Ecks | select | 1 | %SEARCH{"TestForm.Ecks~'Blah*'" type="query" order="topic" separator="," format="$topic;$formfield(Ecks)" nonoise="on"}% | | |
FORM
$topicObject->save();
$topicObject =
Foswiki::Meta->new( $this->{session}, $this->{test_web}, 'SplodgeOne',
<<FORM);
%META:FORM{name="TestForm"}%
%META:FIELD{name="Ecks" attributes="" title="X" value="Blah"}%
FORM
$topicObject->save();

my $actual =
$topicObject->expandMacros(
'%SEARCH{"TestForm.Ecks~\'Blah*\'" type="query" order="topic" separator="," format="$topic;$formfield(Ecks)" nonoise="on"}%'
);
my $expected = 'SplodgeOne;Blah';
$this->assert_str_equals( $expected, $actual );

}

sub verify_Search_expression {
#make sure perl-y characters in SEARCH expressions are escaped well enough
my $this = shift;
Expand Down

0 comments on commit c19bd4f

Please sign in to comment.