-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix to bug found by Andrew Rodland: t+
- Loading branch information
-
committed
Nov 13, 2012
1 parent
266b25b
commit f310016
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/perl | ||
# Copyright 2012 Jeffrey Kegler | ||
# This file is part of Marpa::R2. Marpa::R2 is free software: you can | ||
# redistribute it and/or modify it under the terms of the GNU Lesser | ||
# General Public License as published by the Free Software Foundation, | ||
# either version 3 of the License, or (at your option) any later version. | ||
# | ||
# Marpa::R2 is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser | ||
# General Public License along with Marpa::R2. If not, see | ||
# http://www.gnu.org/licenses/. | ||
|
||
# Regressions tests involving the Stuizand interface | ||
|
||
use 5.010; | ||
use strict; | ||
use warnings; | ||
use Test::More tests => 1; | ||
|
||
use lib 'inc'; | ||
use Marpa::R2::Test; | ||
|
||
## no critic (ErrorHandling::RequireCarping); | ||
|
||
# Marpa::R2::Display | ||
# name: Stuifzand Synopsis | ||
|
||
use Marpa::R2; | ||
|
||
# Regression test of bug found by Andrew Rodland | ||
|
||
my $g = Marpa::R2::Grammar->new( | ||
{ actions => "main", | ||
start => "start", | ||
rules => "start ::= action => act" | ||
} | ||
); | ||
$g->precompute; | ||
my $r = Marpa::R2::Recognizer->new( { grammar => $g } ); | ||
my $value_ref = $r->value; | ||
my $value = defined $value_ref ? ${$value_ref} : 'No parse'; | ||
sub act {123}; | ||
|
||
Test::More::is( $value, '123', 'Rodland regression test' ); | ||
|
||
# vim: expandtab shiftwidth=4: |