--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More qw( no_plan );
+
+use File::Copy;
+use File::Compare;
+use Cwd;
+use YAML;
+
+
+my $orig_cwd = cwd();
+
+opendir(my $dh, $orig_cwd) or die("Opendir failed: $!");
+
+my @tests = grep { /^t-/ } readdir $dh;
+
+for my $testdir (@tests) {
+ my (undef, $test) = split /-/, $testdir, 2;
+
+ chdir $testdir;
+ my $cwd = cwd();
+
+ my $spec = YAML::LoadFile ("spec.yaml");
+
+ if (! $spec) {
+ fail ("$test - loading spec");
+ next;
+ }
+
+ my $success = 1;
+
+ copy("../../blosxom.cgi", ".") or die("Copy failed: $!");
+ chmod(0777, "blosxom.cgi");
+
+ system("perl -pi -e 's{/Library/WebServer/Documents/blosxom}{$cwd/data}' blosxom.cgi") == 0
+ or die "$!";
+
+ for (@{$spec->{tests}}) {
+ my ($args, $output) = @$_;
+
+ system("./blosxom.cgi $args > ${output}.got") == 0
+ or die "$!";
+
+ if (ok(compare("${output}.got", $output) == 0,
+ "$test - Got expected output for args [$args]")) {
+ unlink("${output}.got");
+ } else {
+ $success = 0;
+ }
+ }
+
+ if ($success) {
+ unlink("blosxom.cgi");
+ }
+
+ chdir $orig_cwd;
+}
+
--- /dev/null
+Lorem ipsum
+Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet ipso
+facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor sit
+amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
--- /dev/null
+Lorem ipso
+Lorem ipso hoccer foer tyr wuz de ras cora dola tymon ipso hoc cer fuz
+de ramas cora dola tymon ipso hoccer. Lorem ipso foer tyr wuz de ramas
+cora dola tym ipso hor.Lorem ipso foer tyr wuz de ramas cora dola tym
+ipso hor tyr wuz de ramas cora dola tymon ipso foer tyr wuz de ramas
+cora dola tymo. Lorem ipso hoccer foer tyr wuz de ras cora dola tymon
+ipso hoc cer fuz de ramas cora dola tymon ipso hoccer. Lorem ipso foer
+tyr wuz de ramas cora dola tym ipso hor.
--- /dev/null
+Content-Type: text/html; charset=ISO-8859-1\r
+\r
+<html>
+ <head>
+ <link rel="alternate" type="type="application/rss+xml" title="RSS" href="http://localhost/./blosxom.cgi/index.rss" />
+ <title>My Weblog
+ </title>
+ </head>
+ <body>
+ <center>
+ <font size="+3">My Weblog</font><br />
+
+ </center>
+ <p />
+ <h3>Tue, 25 Jul 2006</h3>
+ <p>
+ <a name="bar"><b>Lorem ipsum</b></a><br />
+ Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet ipso
+facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor sit
+amet ipso facto.Lorem ipsum dolor sit amet ipso facto. <br />
+ <br />
+ posted at: 11:02 | path: <a href="http://localhost/./blosxom.cgi/foo">/foo </a> | <a href="http://localhost/./blosxom.cgi/2006/07/25#bar">permanent link to this entry</a>
+ </p>
+
+ <p />
+ <center>
+ <a href="http://www.blosxom.com/"><img src="http://www.blosxom.com/images/pb_blosxom.gif" border="0" /></a>
+ </center>
+ </body>
+</html>
--- /dev/null
+Content-Type: text/html; charset=ISO-8859-1\r
+\r
+<html>
+ <head>
+ <link rel="alternate" type="type="application/rss+xml" title="RSS" href="http://localhost/./blosxom.cgi/index.rss" />
+ <title>My Weblog
+ </title>
+ </head>
+ <body>
+ <center>
+ <font size="+3">My Weblog</font><br />
+
+ </center>
+ <p />
+ <h3>Tue, 25 Jul 2006</h3>
+ <p>
+ <a name="baz"><b>Lorem ipso</b></a><br />
+ Lorem ipso hoccer foer tyr wuz de ras cora dola tymon ipso hoc cer fuz
+de ramas cora dola tymon ipso hoccer. Lorem ipso foer tyr wuz de ramas
+cora dola tym ipso hor.Lorem ipso foer tyr wuz de ramas cora dola tym
+ipso hor tyr wuz de ramas cora dola tymon ipso foer tyr wuz de ramas
+cora dola tymo. Lorem ipso hoccer foer tyr wuz de ras cora dola tymon
+ipso hoc cer fuz de ramas cora dola tymon ipso hoccer. Lorem ipso foer
+tyr wuz de ramas cora dola tym ipso hor.<br />
+ <br />
+ posted at: 11:03 | path: <a href="http://localhost/./blosxom.cgi/foo">/foo </a> | <a href="http://localhost/./blosxom.cgi/2006/07/25#baz">permanent link to this entry</a>
+ </p>
+ <p>
+ <a name="bar"><b>Lorem ipsum</b></a><br />
+ Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet ipso
+facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor sit
+amet ipso facto.Lorem ipsum dolor sit amet ipso facto. <br />
+ <br />
+ posted at: 11:02 | path: <a href="http://localhost/./blosxom.cgi/foo">/foo </a> | <a href="http://localhost/./blosxom.cgi/2006/07/25#bar">permanent link to this entry</a>
+ </p>
+
+ <p />
+ <center>
+ <a href="http://www.blosxom.com/"><img src="http://www.blosxom.com/images/pb_blosxom.gif" border="0" /></a>
+ </center>
+ </body>
+</html>
--- /dev/null
+Content-Type: text/xml; charset=ISO-8859-1\r
+\r
+<?xml version="1.0"?>
+<!-- name="generator" content="blosxom/2.0.2" -->
+<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">
+
+<rss version="0.91">
+ <channel>
+ <title>My Weblog </title>
+ <link>http://localhost/./blosxom.cgi</link>
+ <description>Yet another Blosxom weblog.</description>
+ <language>en</language>
+
+ <item>
+ <title>Lorem ipsum</title>
+ <link>http://localhost/./blosxom.cgi/2006/07/19#1</link>
+ <description>Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet ipso
+facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor sit
+amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+facto.Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet
+ipso facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor
+sit amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+Lorem ipso hoccer foer tyr wuz de ras cora dola tymon ipso hoc cer fuz
+de ramas cora dola tymon ipso hoccer. Lorem ipso foer tyr wuz de ramas
+cora dola tym ipso hor.Lorem ipso foer tyr wuz de ramas cora dola tym
+ipso hor tyr wuz de ramas cora dola tymon ipso foer tyr wuz de ramas
+cora dola tymo. Lorem ipso hoccer foer tyr wuz de ras cora dola tymon
+ipso hoc cer fuz de ramas cora dola tymon ipso hoccer. Lorem ipso foer
+tyr wuz de ramas cora dola tym ipso hor.</description>
+ </item>
+ </channel>
+</rss>
--- /dev/null
+tests:
+ -
+ - ""
+ - expected.html
+ -
+ - /foo
+ - expected.html
+ -
+ - /foo#bar
+ - expected.html
+ -
+ - /foo/bar.html
+ - expected.bar
+# -
+# - /2006/07/25/bar.html
+# - expected.bar
--- /dev/null
+Lorem ipsum
+Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet ipso
+facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor sit
+amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+facto.Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet
+ipso facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor
+sit amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+Lorem ipso hoccer foer tyr wuz de ras cora dola tymon ipso hoc cer fuz
+de ramas cora dola tymon ipso hoccer. Lorem ipso foer tyr wuz de ramas
+cora dola tym ipso hor.Lorem ipso foer tyr wuz de ramas cora dola tym
+ipso hor tyr wuz de ramas cora dola tymon ipso foer tyr wuz de ramas
+cora dola tymo. Lorem ipso hoccer foer tyr wuz de ras cora dola tymon
+ipso hoc cer fuz de ramas cora dola tymon ipso hoccer. Lorem ipso foer
+tyr wuz de ramas cora dola tym ipso hor.
--- /dev/null
+Content-Type: text/html; charset=ISO-8859-1\r
+\r
+<html>
+ <head>
+ <link rel="alternate" type="type="application/rss+xml" title="RSS" href="http://localhost/./blosxom.cgi/index.rss" />
+ <title>My Weblog
+ </title>
+ </head>
+ <body>
+ <center>
+ <font size="+3">My Weblog</font><br />
+
+ </center>
+ <p />
+ <h3>Wed, 19 Jul 2006</h3>
+ <p>
+ <a name="1"><b>Lorem ipsum</b></a><br />
+ Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet ipso
+facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor sit
+amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+facto.Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet
+ipso facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor
+sit amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+Lorem ipso hoccer foer tyr wuz de ras cora dola tymon ipso hoc cer fuz
+de ramas cora dola tymon ipso hoccer. Lorem ipso foer tyr wuz de ramas
+cora dola tym ipso hor.Lorem ipso foer tyr wuz de ramas cora dola tym
+ipso hor tyr wuz de ramas cora dola tymon ipso foer tyr wuz de ramas
+cora dola tymo. Lorem ipso hoccer foer tyr wuz de ras cora dola tymon
+ipso hoc cer fuz de ramas cora dola tymon ipso hoccer. Lorem ipso foer
+tyr wuz de ramas cora dola tym ipso hor.<br />
+ <br />
+ posted at: 22:54 | path: <a href="http://localhost/./blosxom.cgi"> </a> | <a href="http://localhost/./blosxom.cgi/2006/07/19#1">permanent link to this entry</a>
+ </p>
+
+ <p />
+ <center>
+ <a href="http://www.blosxom.com/"><img src="http://www.blosxom.com/images/pb_blosxom.gif" border="0" /></a>
+ </center>
+ </body>
+</html>
--- /dev/null
+Content-Type: text/xml; charset=ISO-8859-1\r
+\r
+<?xml version="1.0"?>
+<!-- name="generator" content="blosxom/2.0.2" -->
+<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">
+
+<rss version="0.91">
+ <channel>
+ <title>My Weblog </title>
+ <link>http://localhost/./blosxom.cgi</link>
+ <description>Yet another Blosxom weblog.</description>
+ <language>en</language>
+
+ <item>
+ <title>Lorem ipsum</title>
+ <link>http://localhost/./blosxom.cgi/2006/07/19#1</link>
+ <description>Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet ipso
+facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor sit
+amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+facto.Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet
+ipso facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor
+sit amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+Lorem ipso hoccer foer tyr wuz de ras cora dola tymon ipso hoc cer fuz
+de ramas cora dola tymon ipso hoccer. Lorem ipso foer tyr wuz de ramas
+cora dola tym ipso hor.Lorem ipso foer tyr wuz de ramas cora dola tym
+ipso hor tyr wuz de ramas cora dola tymon ipso foer tyr wuz de ramas
+cora dola tymo. Lorem ipso hoccer foer tyr wuz de ras cora dola tymon
+ipso hoc cer fuz de ramas cora dola tymon ipso hoccer. Lorem ipso foer
+tyr wuz de ramas cora dola tym ipso hor.</description>
+ </item>
+ </channel>
+</rss>
--- /dev/null
+tests:
+ -
+ - ""
+ - expected.html
+ -
+ - "flav=rss"
+ - "expected.rss"
--- /dev/null
+Lorem ipsum
+Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet ipso
+facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor sit
+amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+facto.Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet
+ipso facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor
+sit amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+Lorem ipso hoccer foer tyr wuz de ras cora dola tymon ipso hoc cer fuz
+de ramas cora dola tymon ipso hoccer. Lorem ipso foer tyr wuz de ramas
+cora dola tym ipso hor.Lorem ipso foer tyr wuz de ramas cora dola tym
+ipso hor tyr wuz de ramas cora dola tymon ipso foer tyr wuz de ramas
+cora dola tymo. Lorem ipso hoccer foer tyr wuz de ras cora dola tymon
+ipso hoc cer fuz de ramas cora dola tymon ipso hoccer. Lorem ipso foer
+tyr wuz de ramas cora dola tym ipso hor.
--- /dev/null
+text/xhtml; charset=UTF-8
--- /dev/null
+ <h3>$yr-$mo_num-$da</h3>
--- /dev/null
+
+ </body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <link rel="alternate" type="type="application/rss+xml" title="RSS" href="$url/index.rss" />
+ <title>$blog_title $path_info_da $path_info_mo $path_info_yr
+ </title>
+ </head>
+ <body>
+ <h1>$blog_title</h1>
+ <h2>$path_info_da $path_info_mo $path_info_yr</h2>
--- /dev/null
+ <h4><a name="$fn">$title</a></h4>
+ <div>$body</div>
+ <p>posted at: $ti | path: <a href="$url$path">$path </a> | <a href="$url/$yr/$mo_num/$da#$fn">permanent link to this entry</a></p>
--- /dev/null
+Content-Type: text/xhtml; charset=UTF-8\r
+\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <link rel="alternate" type="type="application/rss+xml" title="RSS" href="http://localhost/./blosxom.cgi/index.rss" />
+ <title>My Weblog
+ </title>
+ </head>
+ <body>
+ <h1>My Weblog</h1>
+ <h2> </h2>
+ <h3>2006-07-19</h3>
+ <h4><a name="1">Lorem ipsum</a></h4>
+ <div>Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet ipso
+facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor sit
+amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+facto.Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet
+ipso facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor
+sit amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+Lorem ipso hoccer foer tyr wuz de ras cora dola tymon ipso hoc cer fuz
+de ramas cora dola tymon ipso hoccer. Lorem ipso foer tyr wuz de ramas
+cora dola tym ipso hor.Lorem ipso foer tyr wuz de ramas cora dola tym
+ipso hor tyr wuz de ramas cora dola tymon ipso foer tyr wuz de ramas
+cora dola tymo. Lorem ipso hoccer foer tyr wuz de ras cora dola tymon
+ipso hoc cer fuz de ramas cora dola tymon ipso hoccer. Lorem ipso foer
+tyr wuz de ramas cora dola tym ipso hor.</div>
+ <p>posted at: 22:54 | path: <a href="http://localhost/./blosxom.cgi"> </a> | <a href="http://localhost/./blosxom.cgi/2006/07/19#1">permanent link to this entry</a></p>
+
+ </body>
+</html>
--- /dev/null
+Content-Type: text/xml; charset=ISO-8859-1\r
+\r
+<?xml version="1.0"?>
+<!-- name="generator" content="blosxom/2.0.2" -->
+<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">
+
+<rss version="0.91">
+ <channel>
+ <title>My Weblog </title>
+ <link>http://localhost/./blosxom.cgi</link>
+ <description>Yet another Blosxom weblog.</description>
+ <language>en</language>
+
+ <item>
+ <title>Lorem ipsum</title>
+ <link>http://localhost/./blosxom.cgi/2006/07/19#1</link>
+ <description>Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet ipso
+facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor sit
+amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+facto.Lorem ipsum dolor sit amet ipso facto.Lorem ipsum dolor sit amet
+ipso facto.Lorem ipsum dolor sit amet ipso facto. Lorem ipsum dolor
+sit amet ipso facto.Lorem ipsum dolor sit amet ipso facto.
+
+Lorem ipso hoccer foer tyr wuz de ras cora dola tymon ipso hoc cer fuz
+de ramas cora dola tymon ipso hoccer. Lorem ipso foer tyr wuz de ramas
+cora dola tym ipso hor.Lorem ipso foer tyr wuz de ramas cora dola tym
+ipso hor tyr wuz de ramas cora dola tymon ipso foer tyr wuz de ramas
+cora dola tymo. Lorem ipso hoccer foer tyr wuz de ras cora dola tymon
+ipso hoc cer fuz de ramas cora dola tymon ipso hoccer. Lorem ipso foer
+tyr wuz de ramas cora dola tym ipso hor.</description>
+ </item>
+ </channel>
+</rss>
--- /dev/null
+tests:
+ -
+ - ""
+ - expected.html