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

h_many1's test is failing for the same reason as h_many

parent e9de0663
No related branches found
No related tags found
No related merge requests found
<?php
include_once 'hammer.php';
class Many1Test extends PHPUnit_Framework_TestCase
{
protected $parser;
protected function setUp()
{
$this->parser = h_many1(choice(ch("a"), ch("b")));
}
public function testSuccess()
{
$result1 = h_parse($this->parser, "a");
$result2 = h_parse($this->parser, "b");
$result3 = h_parse($this->parser, "aabbaba");
$this->assertEquals(array("a"), $result1);
$this->assertEquals(array("b"), $result2);
$this->assertEquals(array("c"), $result3);
}
public function testFailure()
{
$result1 = h_parse($this->parser, "");
$result2 = h_parse($this->parser, "daabbabadef");
$this->assertEquals(NULL, $result1);
$this->assertEquals(NULL, $result2);
}
}
?>
\ 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