Skip to content
Permalink
Browse files

Item10889: Test OP_eq against notafield

Conflicts:

	test/unit/QueryTests.pm

git-svn-id: http://svn.foswiki.org/branches/Release01x01@11983 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
PaulHarvey PaulHarvey
PaulHarvey authored and PaulHarvey committed Jun 18, 2011
1 parent b9bc925 commit 46c27164612f5b906cd195a8d1ef4b46904c0802
Showing with 34 additions and 0 deletions.
  1. +34 −0 UnitTestContrib/test/unit/QueryTests.pm
@@ -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 );

0 comments on commit 46c2716

Please sign in to comment.
You can’t perform that action at this time.