h_in and h_not_in also have a wrong param count issue

This commit is contained in:
Meredith L. Patterson 2013-11-30 17:17:18 -08:00
parent ce5a621ee3
commit 48d6cf6f88
2 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,24 @@
<?php
include_once 'hammer.php';
class InTest extends PHPUnit_Framework_TestCase
{
protected $parser;
protected function setUp()
{
$this->parser = h_in("abc");
}
public function testSuccess()
{
$result = h_parse($this->parser, "b");
// TODO: fixme when h_ch is fixed
$this->assertEquals(98, $result);
}
public function testFailure()
{
$result = h_parse($this->parser, "d");
$this->assertEquals(NULL, $result);
}
}
?>

View file

@ -0,0 +1,24 @@
<?php
include_once 'hammer.php';
class NotInTest extends PHPUnit_Framework_TestCase
{
protected $parser;
protected function setUp()
{
$this->parser = h_not_in("abc");
}
public function testSuccess()
{
$result = h_parse($this->parser, "d");
// TODO: fixme when h_ch is fixed
$this->assertEquals(100, $result);
}
public function testFailure()
{
$result = h_parse($this->parser, "b");
$this->assertEquals(NULL, $result);
}
}
?>