Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Polgár Márton
committed
Mar 8, 2023
1 parent
05d9810
commit e259e08
Showing
7 changed files
with
68 additions
and
4 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
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 |
---|---|---|
|
@@ -31,5 +31,5 @@ | |
], | ||
"test-depends": [ | ||
], | ||
"version": "0.11.2" | ||
"version": "0.11.3" | ||
} |
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
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 |
---|---|---|
|
@@ -56,4 +56,8 @@ method declone { | |
$.parent || self | ||
} | ||
|
||
method reset { | ||
%!data = Empty; | ||
} | ||
|
||
# vim: expandtab shiftwidth=4 |
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,57 @@ | ||
use Test; | ||
use Template6; | ||
|
||
plan 2; | ||
|
||
my $t6-noreset = Template6.new; | ||
$t6-noreset.add-path: 't/templates'; | ||
my $t6-reset = Template6.new: :reset; | ||
$t6-reset.add-path: 't/templates'; | ||
|
||
my @ul = 'First', 'Second', 'Third'; | ||
my @ol = 'One', 'Two', 'Three'; | ||
# we know the result from 02-for.rakutest and we don't really care here anyway | ||
# it's an organic way to set the stash | ||
$t6-noreset.process('for', :title<For Test>, :@ul, :@ol); | ||
$t6-reset.process('for', :title<For Test>, :@ul, :@ol); | ||
|
||
|
||
my $wanted-noreset = "<html> | ||
<head> | ||
<title>For Test</title> | ||
</head> | ||
<body> | ||
<ul> | ||
<li>First</li> | ||
<li>Second</li> | ||
<li>Third</li> | ||
</ul> | ||
<ol> | ||
<li>Ain't</li> | ||
<li>Nobody</li> | ||
</ol> | ||
</body> | ||
</html> | ||
"; | ||
|
||
my $wanted-reset = "<html> | ||
<head> | ||
<title>For Test</title> | ||
</head> | ||
<body> | ||
<ul> | ||
</ul> | ||
<ol> | ||
<li>Ain't</li> | ||
<li>Nobody</li> | ||
</ol> | ||
</body> | ||
</html> | ||
"; | ||
|
||
@ol = <Ain't Nobody>; | ||
is $t6-noreset.process('for', :title<For Test>, :@ol), $wanted-noreset, 'Unmodified variable stays set.'; | ||
is $t6-reset.process('for', :title<For Test>, :@ol), $wanted-reset, 'Unmodified variable gets reset.'; | ||
|
||
|
||
# vim: expandtab shiftwidth=4 |