Skip to content
Snippets Groups Projects
Commit be08c128 authored by Meredith L. Patterson's avatar Meredith L. Patterson
Browse files

h_int_range works

parent c89f3dc7
No related branches found
No related tags found
No related merge requests found
<?php
include_once 'hammer.php';
class IntRangeTest extends PHPUnit_Framework_TestCase
{
protected $parser;
protected function setUp()
{
$this->parser = h_int_range(h_uint8(), 3, 10);
}
public function testSuccess()
{
$result = h_parse($this->parser, "\x05");
$this->assertEquals(5, $result);
}
public function testFailure()
{
$result = h_parse($this->parser, "\xb");
$this->assertEquals(NULL, $result);
}
}
?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment