Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
82 lines (53 sloc) 1.5 KB
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More 'no_plan';
use Text::Haml;
use FindBin;
use JSON 'from_json';
our $VERSION = 0.990101;
my $tests;
open FILE, "< $FindBin::Bin/tests.json" or die $!;
$tests = from_json(join("\n", <FILE>));
close FILE;
while (my ($section_name, $section) = each %$tests) {
diag $section_name;
while (my ($test_name, $test) = each %$section) {
is( Text::Haml->new(%{$test->{config}}, vars_as_subs => 1)
->render($test->{haml}, %{$test->{locals}}),
$test->{html}, $test_name
=head1 NAME - Text::Haml spec tests runner
$ perl
# conditional comments
ok 1 - a conditional comment
# tags with nested content
ok 2 - a tag with CSS
ok 81 - an inline comment
ok 82 - a nested comment
This file is a part of Haml spec tests envorinment. It tests Perl
implementation using <Text::Haml>.
* Text::Haml (available via CPAN or
* JSON (available on CPAN)
* Test::More (included in Perl core)
* FindBin (included in Perl core)
=head1 SEE ALSO
=head1 AUTHOR
Viacheslav Tykhanovskyi, C<>.
Copyright (C) 2009, Viacheslav Tykhanovskyi
This program is free software, you can redistribute it and/or modify it under
the terms of the Artistic License version 2.0.
Jump to Line
Something went wrong with that request. Please try again.