|
|
- #!/usr/bin/perl
-
- =pod
-
- =head1 NAME
-
- validate.pl - W3C validate markup from Display.pm
-
- =head1 SYNOPSIS
-
- Given a working installation and configuration file:
-
- ./validate.pl
-
- =head1 DESCRIPTION
-
- These tests are aimed at a working installation with several files in place,
- and require Test::HTML::W3C as well as Test::Simple. For the time being, I'm
- using "valid W3C HTML" as a proxy for "not broken", and a number of larger
- pages as a proxy for their component features.
-
- =head1 SEE ALSO
-
- Test::HTML::W3C.
-
- =cut
-
- use strict;
- use warnings;
- use lib 'lib';
- use Test::HTML::W3C 'show_detail';
- use Test::Simple tests => 12;
-
- use Display qw(%WalaConf %DISPLAY_CONF);
-
- # TESTS
-
- section ('configuration');
-
- ok (do("conf.pl"), "configuration on conf.pl");
-
- # This will turn off stuff that breaks testing.
- $WalaConf{TestMode} = 1;
-
- section ('starting markup validation');
-
- render('2006', 'Year validates.');
- render('2006/7', 'Month validates.');
- render('2007/7/14', 'Day validates.');
-
- # END OF TESTS
-
- # Utility routines.
-
- sub pause {
- my $time = shift;
- #print " pausing $time seconds\n";
- sleep $time;
- }
-
- sub section {
- my $msg = shift;
- print "\n-- $msg --\n\n";
- }
-
- sub render {
- my $page = shift;
- my $msg = shift;
-
- is_valid_markup (
- Display::handle($page),
- $msg
- ) or diag_html();
-
- pause(1);
-
- }
-
|