diff --git a/lib/WebGUI/Macro.pm b/lib/WebGUI/Macro.pm index a18a363d2..7b5045903 100644 --- a/lib/WebGUI/Macro.pm +++ b/lib/WebGUI/Macro.pm @@ -161,26 +161,38 @@ sub _processMacro { $parameters =~ s/^\(//; $parameters =~ s/\)$//; - # there are two possible matches and only one will ever match at a time, so we filter out the undef ones - my @params = grep { defined $_ } ($parameters =~ / + my @params; + while ($parameters =~ / (?config->addToHash('macros', "Ex'tras", "Extras"); -plan tests => 33; +plan tests => 35; my $macroText = "CompanyName: ^c;"; my $companyName = $session->setting->get('companyName'); @@ -200,6 +200,23 @@ is( "Carriage returns pass through as needed." ); +my $macroText = qq|^ReverseParams(1,'Single quoted parameters work properly',2);|; +WebGUI::Macro::process($session, \$macroText), +is( + $macroText, + "2Single quoted parameters work properly1", + "Single quoted parameters work properly." +); + +my $macroText = qq|^ReverseParams(1,'Escaped single\\' quotes work',2);|; +WebGUI::Macro::process($session, \$macroText), +is( + $macroText, + "2Escaped single' quotes work1", + "Escaped single quotes work." +); + + tie my %quotingEdges, 'Tie::IxHash'; %quotingEdges = ( '^VisualMacro(text);' => '@MacroCall[`text`]:', @@ -217,7 +234,7 @@ while (my ($inText, $outText) = each %quotingEdges) { is( $procText, $outText, - "Nesting edge case: $inText", + "Quoting/Nesting edge case: $inText", ); }