Skip to content

Commit

Permalink
Tested XPath functions and booleans in ok()
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Aug 30, 2009
1 parent 24c1e5d commit 1ce8e05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion t/simple.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w

use strict;
use Test::Builder::Tester tests => 13;
use Test::Builder::Tester tests => 15;
use Test::More;

BEGIN { use_ok 'Test::XPath' or die; }
Expand Down Expand Up @@ -52,3 +52,11 @@ $xp->xpath_is('/html/body/p/@class', 'foo', 'Should get attribute value');

# Try a function.
$xp->xpath_is('count(/html/body/p)', 2, 'Should work for functions');

# Try a boolean function.
$xp->xpath_ok('boolean(1)', 'Boolean should work');

# Try a false boolean.
test_out('not ok 1 - false boolean');
$xp->xpath_ok('false()', 'false boolean');
test_test( skip_err => 1 );
2 changes: 1 addition & 1 deletion t/strongrrl.html
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Strongrrl: Design with muscle</title>
<link rel="stylesheet" type="text/css" href="/ui/css/splash.css" />
</head>
Expand Down

0 comments on commit 1ce8e05

Please sign in to comment.