h_difference works

This commit is contained in:
Meredith L. Patterson 2013-12-01 21:21:00 -08:00
parent 378710844b
commit 0c9ab03fd7

View file

@ -0,0 +1,25 @@
<?php
include_once 'hammer.php';
class DifferenceTest extends PHPUnit_Framework_TestCase
{
protected $parser;
protected function setUp()
{
$this->parser = h_difference(h_token("ab"), ch("a"));
}
public function testSuccess()
{
$result = h_parse($this->parser, "ab");
$this->assertEquals("ab", $result);
}
public function testFailure()
{
$result = h_parse($this->parser, "a");
$this->assertEquals(NULL, $result);
}
}
?>