Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6918b4ee73
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (28 sloc) 0.708 kb
use v6;
use Test;
use Hitomi;
plan 2;
{
my Hitomi::MarkupTemplate $template .= new('<html>
<h1>Hello, $name!</h1>
</html>
');
my Hitomi::Stream $stream = $template.generate( :name<world> );
is $stream.render('html', :doctype(Hitomi::DocType::HTML5)),
'<!DOCTYPE html>
<html>
<h1>Hello, world!</h1>
</html>
', 'simple variable substitution works';
}
{
my Hitomi::MarkupTemplate $template .= new('<html>
<h1>Hello, ${ $name }</h1></html>
');
my Hitomi::Stream $stream = $template.generate( :name<world> );
is $stream.render('html', :doctype(Hitomi::DocType::HTML5)), '<!DOCTYPE html>
<html>
<h1>Hello, world!</h1>
</html>
', 'dollar block substitution works';
}
Jump to Line
Something went wrong with that request. Please try again.