diff options
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/it.t | 18 | ||||
| -rwxr-xr-x | tests/it_html.t | 18 | ||||
| -rwxr-xr-x | tests/it_xml.t | 2 | 
3 files changed, 19 insertions, 19 deletions
@@ -123,7 +123,7 @@ match(  match(  	'[\w]+', '  \\\\aword[[[]]]   ',  	'aword', -	'replace \w in [\w] correctly (match)', +	'replace \w in [\w] correctly (match)'  	);  match(  	'[\\\\w]+', ' blabergna ', @@ -133,7 +133,7 @@ match(  match(  	'[\\\\w]+', '  \\\\worda[[[]',  	'\\\\w', -	'don\'t parse \w in [\\\\w] (match)', +	'don\'t parse \w in [\\\\w] (match)'  	);  match(  	'[a\W]+', 'bbbbbbb a a%$+ accccc', @@ -161,7 +161,7 @@ is(  	'test tr regex function'  	);  is( -	it::match( '\w+', 'word1 wörd2 word_3', 'all' => true ), +	it::match( '\w+', 'word1 wörd2 word_3', array('all' => true )),  	array( 'word1', 'wörd2', 'word_3' ),  	"test match_all function"  	); @@ -176,29 +176,29 @@ match(  	'match umlaute in latin1 case insensitive'  	);  is( -	it::match( 'abc', "aBc", 'casesensitive' => 1 ), +	it::match( 'abc', "aBc", array('casesensitive' => 1 )),  	false,  	"set case sensitivity by parameter"  	);  is( -	it::match( '\w+', 'word1 wörd2 word_3', 'all' => 1 ), +	it::match( '\w+', 'word1 wörd2 word_3', array('all' => 1 )),  	array( 'word1', 'wörd2', 'word_3' ),  	"test all=>1 without captures"  	);  is( -	it::match( '\w+\s+(\d+)', 'word1 12 wörd2 3 word_3 4', 'all' => 1 ), +	it::match( '\w+\s+(\d+)', 'word1 12 wörd2 3 word_3 4', array('all' => 1 )),  	array( '12', '3', '4' ),  	"test all=>1 with one capture"  	);  is( -	it::match( '(\w+)\s+(\d+)', 'word1 12 wörd2 3 word_3 4', 'all' => 1 ), +	it::match( '(\w+)\s+(\d+)', 'word1 12 wörd2 3 word_3 4', array('all' => 1 )),  	array( array( 'word1', '12' ), array( 'wörd2', '3' ), array( 'word_3', '4' ) ),  	"test all=>1 with captures"  	);  is( -	it::match( '(\w+)\s+(\d+)', 'word1 12 wörd2 3 word_3 4', 'all' => 1, 'pattern_order' => 1 ), +	it::match( '(\w+)\s+(\d+)', 'word1 12 wörd2 3 word_3 4', array('all' => 1, 'pattern_order' => 1 )),  	array( array( 'word1', 'wörd2', 'word_3' ), array( '12', '3', '4' ) ), -	"test all=>1,pattern_order=>1", +	"test all=>1,pattern_order=>1"  	);  ?> diff --git a/tests/it_html.t b/tests/it_html.t index 965e4a1..cd934be 100755 --- a/tests/it_html.t +++ b/tests/it_html.t @@ -6,10 +6,10 @@  require 'searchlib/search_test.class';  # Traditional html generation -new it_html('htmltype' => "html"); +new it_html(array('htmltype' => "html"));  is( -	a('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => "", "bar"), +	a(array('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => ""), "bar"),  	'<a href="&foo" true empty="">bar</a>',  	"tag with attributes"  ); @@ -21,7 +21,7 @@ is(  );  is( -	img('src' => "foo.png"), +	img(array('src' => "foo.png")),  	'<img src="foo.png">',  	"empty link tag"  ); @@ -40,7 +40,7 @@ is(  # XML generation  unset($GLOBALS['it_html']); -new it_html('htmltype' => "xhtml", 'tags' => "xmltest"); +new it_html(array('htmltype' => "xhtml", 'tags' => "xmltest"));  is(  	xmltest(), @@ -55,7 +55,7 @@ is(  );  is( -	xmltest('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => ""), +	xmltest(array('href' => "&foo", 'true' => true, 'false' => false, 'null' => null, 'empty' => "")),  	'<xmltest href="&foo" true="true" empty="" />' . "\n",  	"xmltest tag with attributes"  ); @@ -65,17 +65,17 @@ class myhtml extends it_html  {  function myimg($args)  { -        array_unshift($args, 'alt' => "ALT", 'bar' => "BAR"); +        array_unshift($args, array('alt' => "ALT", 'bar' => "BAR"));          return parent::img($args);  }  }  unset($GLOBALS['it_html']); -new myhtml('htmltype' => "html"); +new myhtml(array('htmltype' => "html"));  is( -	myimg('src' => "foo.gif", 'alt' => "foo"), +	myimg(array('src' => "foo.gif", 'alt' => "foo")),  	'<img alt="foo" bar="BAR" src="foo.gif">',  	"it_html inheritance"  ); @@ -90,7 +90,7 @@ is(  );  is( -	U("/foo.html", 'bar' => array('gna' => 42, 'qux' => array('quux' => "<Zürich>", 'gnöp' => "fasel"))), +	U("/foo.html", array('bar' => array('gna' => 42, 'qux' => array('quux' => "<Zürich>", 'gnöp' => "fasel")))),  	'/foo.html?bar[gna]=42&bar[qux][quux]=%3CZ%FCrich%3E&bar[qux][gn%F6p]=fasel',  	'U() with nested arrays'  ); diff --git a/tests/it_xml.t b/tests/it_xml.t index 5d652cc..5651fbe 100755 --- a/tests/it_xml.t +++ b/tests/it_xml.t @@ -14,7 +14,7 @@ function match($xmldata, $expected, $name, $prefix = "")  	is(  		preg_replace('/[#\s]+/', " ", print_r($xml->$varname, true)),  		$expected, -		$name, +		$name  	);  }  |