forked from gitpan/Text-MacroScript
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #41: Macro/script arguments do not nest
- Loading branch information
1 parent
d37c93b
commit 7308638
Showing
2 changed files
with
25 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/perl | ||
|
||
# Copyright (c) 2015 Paulo Custodio. All Rights Reserved. | ||
# May be used/distributed under the GPL. | ||
|
||
use strict; | ||
use warnings; | ||
use Test::More; | ||
|
||
my $ms; | ||
use_ok 'Text::MacroScript'; | ||
|
||
$ms = new_ok('Text::MacroScript' => [ | ||
-macro => [ | ||
[ ADD1 => '#0+#1' ], | ||
], | ||
-script => [ | ||
[ ADD2 => '#0+#1' ], | ||
]]); | ||
|
||
is $ms->expand("ADD1[ ADD1[1|2] | ADD1[3|4] ]"), " 1+2 + 3+4 "; | ||
is $ms->expand("ADD2[ ADD2[1|2] | ADD2[3|4] ]"), "10"; | ||
|
||
done_testing; |
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