TT_BYTES is converting properly; TT_UINT is not.

This commit is contained in:
Meredith L. Patterson 2013-11-24 20:12:54 -06:00
parent 49ca034b32
commit ddbde60396
3 changed files with 84 additions and 27 deletions

View file

@ -0,0 +1,24 @@
<?php
include_once 'hammer.php';
class ChTest extends PHPUnit_Framework_TestCase
{
protected $parser;
protected function setUp()
{
$this->parser = h_ch("\xa2");
}
public function testSuccess()
{
$result = h_parse($this->parser, "\xa2");
$this->assertEquals("\xa2", $result);
}
public function testFailure()
{
$result = h_parse($this->parser, "95");
$this->assertEquals(NULL, $result);
}
}
?>

View file

@ -8,12 +8,11 @@ class TokenTest extends PHPUnit_Framework_TestCase
protected function setUp()
{
$this->parser = hammer::h_token("95\xa2");
$this->parser = h_token("95\xa2");
}
public function testSuccess()
{
$result = hammer::h_parse($this->parser, "95\xa2");
var_dump($result);
$result = h_parse($this->parser, "95\xa2");
$this->assertEquals("95\xa2", $result);
}
public function testFailure()