Skip to content

Commit

Permalink
Item10889: Test OP_eq against notafield
Browse files Browse the repository at this point in the history
Conflicts:

	test/unit/QueryTests.pm

git-svn-id: http://svn.foswiki.org/branches/Release01x01@11983 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey authored and PaulHarvey committed Jun 18, 2011
1 parent b9bc925 commit 46c2716
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions UnitTestContrib/test/unit/QueryTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,40 @@ sub verify_d2n {
$this->check( "d2n notatime", eval => undef );
}

sub verify_string_bops {
my $this = shift;
$this->check( "string='String'", eval => 1 );
$this->check( "string='String '", eval => 0 );
$this->check( "string~'String '", eval => 0 );
$this->check( "string~notafield", eval => 0 );
$this->check( "notafield=~'SomeTextToTestFor'", eval => 0 );
$this->check( "string!=notafield", eval => 1 );
$this->check( "string=notafield", eval => 0 );
$this->check( "string='Str'", eval => 0 );
$this->check( "string~'?trin?'", eval => 1 );
$this->check( "string~'*'", eval => 1 );
$this->check( "string~'*String'", eval => 1 );
$this->check( "string~'*trin*'", eval => 1 );
$this->check( "string~'*in?'", eval => 1 );
$this->check( "string~'*ri?'", eval => 0 );
$this->check( "string~'??????'", eval => 1 );
$this->check( "string~'???????'", eval => 0 );
$this->check( "string~'?????'", eval => 0 );
$this->check( "'SomeTextToTestFor'~'Text'", eval => 0, simpler => 0 );
$this->check( "'SomeTextToTestFor'~'*Text'", eval => 0, simpler => 0 );
$this->check( "'SomeTextToTestFor'~'Text*'", eval => 0, simpler => 0 );
$this->check( "'SomeTextToTestFor'~'*Text*'", eval => 1, simpler => 1 );
$this->check( "string!='Str'", eval => 1 );
$this->check( "string!='String '", eval => 1 );
$this->check( "string!='String'", eval => 0 );
$this->check( "string!='string'", eval => 1 );
$this->check( "string='string'", eval => 0 );
$this->check( "macro='\%RED\%'", eval => 1, syntaxOnly => 1 );
$this->check( "macro~'\%RED?'", eval => 1, syntaxOnly => 1 );
$this->check( "macro~'?RED\%'", eval => 1, syntaxOnly => 1 );
$this->check( "macro~'?RED\%'", eval => 1, syntaxOnly => 1 );
}

sub verify_constants {
my $this = shift;
$this->check( "undefined", eval => undef );
Expand Down

0 comments on commit 46c2716

Please sign in to comment.