#!/usr/bin/env perl use strict; use warnings; use Test::More tests => 6; use Text::Haml; my $haml = Text::Haml->new; # :escaped my $output = $haml->render(<<'EOF'); :escaped <&"> EOF is($output, <<'EOF'); <&"> EOF # :plain $output = $haml->render(<<'EOF'); :plain This is a plain text. EOF is($output, <<'EOF'); This is a plain text. EOF # :preserve $output = $haml->render(<<'EOF'); :preserve No empty line is ignored. %p EOF is($output, <<'EOF'); No empty line is ignored.
EOF # :javascript $output = $haml->render(<<'EOF'); :javascript alert('boo'); %p EOF is($output, <<'EOF'); EOF # custom $haml->add_filter(compress => sub { $_[0] =~ s/\s+/ /g; $_[0] }); $output = $haml->render(<<'EOF'); :compress A line with many spaces! EOF is($output, <<'EOF'); A line with many spaces! EOF # :plain $output = $haml->render(<<'EOF'); :plain This is a plain text - filter name with trailing whitespace. EOF is($output, <<'EOF'); This is a plain text - filter name with trailing whitespace. EOF