li:first ~ *',
		array(
			'li#testID',
			'li',
		)
	),
	// CSS3 pseudoclasses
	array(
		'li:only-child',
		array(
			'li.nested',
		)
	),
	array(
		'p[rel=test]:parent',
		array(
			'p',
			'p',
		)
	),
	array(
		'li:first-child',
		array(
			'li',
			'li#i_have_nested_list',
			'li.nested',
		)
	),
	array(
		':last-child',
		array(
			'html',
			'script',
			'body',
			'p.body',
			'p.body',
			'li',
			'p.body',
			'p.after',
			'ul',
			'ul',
			'li.nested',
			'li.second',
		)
	),
	array(
		':nth-child(1n+1)',
		array(
			'html',
			'head',
			'meta',
			'div.articles',
			'ul',
			'li',
			'p',
			'p',
			'p',
			'li#i_have_nested_list',
			'ul',
			'li.nested',
		)
	),
	array(
		':nth-child(3n+6)',
		array(
			'script',
			'p.body',
			'p.body',
			'li',
			'p.body',
		)
	),
	array(
		':nth-child(2n)',
		array(
			'title',
			'script',
			'body',
			'p.title',
			'li#testID',
			'p.title',
			'p.noTitle',
			'p.after',
			'ul',
			'li.second',
		)
	),
	array(
		':nth-child(1)',
		array(
			'html',
			'head',
			'meta',
			'div.articles',
			'ul',
			'li',
			'p',
			'p',
			'p',
			'li#i_have_nested_list',
			'ul',
			'li.nested',
		)
	),
	array(
		':nth-child(odd)',
		array(
			'html',
			'head',
			'meta',
			'script',
			'div.articles',
			'ul',
			'li',
			'p',
			'p.body',
			'p',
			'p.body',
			'li',
			'p',
			'p.body',
			'li#i_have_nested_list',
			'ul',
			'li.nested',
		)
	),
	array(
		':nth-child(even)',
		array(
			'title',
			'script',
			'body',
			'p.title',
			'li#testID',
			'p.title',
			'p.noTitle',
			'p.after',
			'ul',
			'li.second',
		)
	),
	array(
		':empty',
		array(
			'meta',
			'script',
			'script',
			'li.nested',
		)
	),
//	array(
//		'',
//		array(
//			'',
//		)
//	),
//	array(
//		'',
//		array(
//			'',
//		)
//	),
//	array(
//		'',
//		array(
//			'',
//		)
//	),
);
phpQuery::newDocumentFile('test.html');
foreach( $tests as $k => $test ) {
	$tests[ $k ][2] = pq( $test[0] )->whois();
}
foreach( $tests as $test ) {
	if ( $test[1] == $test[2] )
		print "Test '{$test[0]}' PASSED :)";
	else {
		print "Test '{$test[0]}' FAILED !!!";
		print_r($test[2]);
	}
	print "
";
}
//
$testName = 'Complicated selector 1';
phpQuery::newDocumentFile('test.html');
pq('')
	->appendTo('body');
$result = pq('select[name="test[]"]:has(option[value=3])');
if ( $result->size() == 1 )
	print "Test '{$testName}' PASSED :)";
else
	print "Test '{$testName}' FAILED !!! ";
$result->dump();
print "\n";
?>