h_difference works
This commit is contained in:
parent
378710844b
commit
0c9ab03fd7
1 changed files with 25 additions and 0 deletions
25
src/bindings/php/Tests/DifferenceTest.php
Normal file
25
src/bindings/php/Tests/DifferenceTest.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue