diff --git a/src/bindings/php/Tests/RightrecTest.php b/src/bindings/php/Tests/RightrecTest.php new file mode 100644 index 0000000..9580fde --- /dev/null +++ b/src/bindings/php/Tests/RightrecTest.php @@ -0,0 +1,24 @@ +parser = h_indirect(); + h_bind_indirect($this->parser, choice(sequence(ch("a"), $this->parser), h_epsilon_p())); + } + + public function testSuccess() + { + $result1 = h_parse($this->parser, "a"); + $result2 = h_parse($this->parser, "aa"); + $result3 = h_parse($this->parser, "aaa"); + $this->assertEquals(array("a"), $result1); + $this->assertEquals(array("a", array("a")), $result2); + $this->assertEquals(array("a", array("a", array("a"))), $result3); + } +} +?> \ No newline at end of file