From: Gavin Carr Date: Fri, 5 Oct 2007 12:06:51 +0000 (+0000) Subject: Refactor and fix current test cases. X-Git-Tag: v2_1_0~37 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=175a8afc17dc934e433967d7f3c6797a89a17424;p=matthijs%2Fupstream%2Fblosxom.git Refactor and fix current test cases. --- diff --git a/t/04_plugin_dir.t b/t/04_plugin_dir.t index c27c35b..f176604 100644 --- a/t/04_plugin_dir.t +++ b/t/04_plugin_dir.t @@ -1,35 +1,67 @@ -# blosxom standard $plugin_dir testing +#!/usr/bin/perl use strict; -use Test::More tests => 1; -use Test::Differences; +use warnings; + +use Test::More qw( no_plan ); + use Cwd; +use YAML; use IO::File; +use File::Find; +use File::Copy; +#use File::Touch; +use File::Basename; +use Test::Differences; + +my $test = basename($0); +$test =~ s/^\d+_?//; +$test =~ s/\.t$//; -my $blosxom_root = 'plugin_dir'; -$blosxom_root = "t/$blosxom_root" if -d "t/$blosxom_root"; -$blosxom_root = cwd . "/$blosxom_root"; -die "cannot find root '$blosxom_root'" - unless -d $blosxom_root; +my $testdir = $test; +$testdir = "t/$testdir" if -d "t/$testdir"; +$testdir = cwd . "/$testdir"; +die "cannot find root '$testdir'" unless -d $testdir; -my $blosxom_config_dir = "$blosxom_root/config"; +my $blosxom_config_dir = "$testdir/config"; die "cannot find blosxom config dir '$blosxom_config_dir'" unless -d $blosxom_config_dir; $ENV{BLOSXOM_CONFIG_DIR} = $blosxom_config_dir; -my $blosxom_cgi = "$blosxom_root/../../blosxom.cgi"; +my $blosxom_cgi = "$testdir/../../blosxom.cgi"; die "cannot find blosxom.cgi '$blosxom_cgi'" unless -f $blosxom_cgi; die "blosxom.cgi '$blosxom_cgi' is not executable" unless -x $blosxom_cgi; -my $fh = IO::File->new("$blosxom_root/expected.html", 'r') - or die "cannot open expected output file '$blosxom_root/expected.html': $!"; -my $expected; -{ - local $/ = undef; - $expected = <$fh>; - $fh->close; -} +my $spec = YAML::LoadFile ("$testdir/spec.yaml") + or fail("$test - loading spec") and next; -my $output = qx($blosxom_cgi); +touch_files("$testdir/data"); -eq_or_diff($output, $expected, 'html output ok'); +my %expected = (); +for (@{$spec->{tests}}) { + my ($args, $output) = @$_; + + unless ($expected{$output}) { + my $fh = IO::File->new("$testdir/$output", 'r') + or die "cannot open expected output file '$output': $!"; + { + local $/ = undef; + $expected{$output} = <$fh>; + } + $fh->close; + } + + my $got = qx($blosxom_cgi $args); + + eq_or_diff($got, $expected{$output}, "$test - got expected output for args [$args]", { style => 'Unified' }); +} + +sub touch_files { + find( sub { + if (/^(.*)\.(\d+)$/) { + copy($_, $1); + `touch -t $2 $1`; + } + }, + shift ); +} diff --git a/t/05_plugin_list.t b/t/05_plugin_list.t deleted file mode 100644 index 5e4e952..0000000 --- a/t/05_plugin_list.t +++ /dev/null @@ -1,35 +0,0 @@ -# blosxom $plugin_list testing - -use strict; -use Test::More tests => 1; -use Test::Differences; -use Cwd; -use IO::File; - -my $blosxom_root = 'plugin_list'; -$blosxom_root = "t/$blosxom_root" if -d "t/$blosxom_root"; -$blosxom_root = cwd . "/$blosxom_root"; -die "cannot find root '$blosxom_root'" - unless -d $blosxom_root; - -my $blosxom_config_dir = "$blosxom_root/config"; -die "cannot find blosxom config dir '$blosxom_config_dir'" unless -d $blosxom_config_dir; -$ENV{BLOSXOM_CONFIG_DIR} = $blosxom_config_dir; - -my $blosxom_cgi = "$blosxom_root/../../blosxom.cgi"; -die "cannot find blosxom.cgi '$blosxom_cgi'" unless -f $blosxom_cgi; -die "blosxom.cgi '$blosxom_cgi' is not executable" unless -x $blosxom_cgi; - -my $fh = IO::File->new("$blosxom_root/expected.html", 'r') - or die "cannot open expected output file '$blosxom_root/expected.html': $!"; -my $expected; -{ - local $/ = undef; - $expected = <$fh>; - $fh->close; -} - -my $output = qx($blosxom_cgi); - -eq_or_diff($output, $expected, 'html output ok'); - diff --git a/t/driver b/t/driver new file mode 100644 index 0000000..f176604 --- /dev/null +++ b/t/driver @@ -0,0 +1,67 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Test::More qw( no_plan ); + +use Cwd; +use YAML; +use IO::File; +use File::Find; +use File::Copy; +#use File::Touch; +use File::Basename; +use Test::Differences; + +my $test = basename($0); +$test =~ s/^\d+_?//; +$test =~ s/\.t$//; + +my $testdir = $test; +$testdir = "t/$testdir" if -d "t/$testdir"; +$testdir = cwd . "/$testdir"; +die "cannot find root '$testdir'" unless -d $testdir; + +my $blosxom_config_dir = "$testdir/config"; +die "cannot find blosxom config dir '$blosxom_config_dir'" unless -d $blosxom_config_dir; +$ENV{BLOSXOM_CONFIG_DIR} = $blosxom_config_dir; + +my $blosxom_cgi = "$testdir/../../blosxom.cgi"; +die "cannot find blosxom.cgi '$blosxom_cgi'" unless -f $blosxom_cgi; +die "blosxom.cgi '$blosxom_cgi' is not executable" unless -x $blosxom_cgi; + +my $spec = YAML::LoadFile ("$testdir/spec.yaml") + or fail("$test - loading spec") and next; + +touch_files("$testdir/data"); + +my %expected = (); + +for (@{$spec->{tests}}) { + my ($args, $output) = @$_; + + unless ($expected{$output}) { + my $fh = IO::File->new("$testdir/$output", 'r') + or die "cannot open expected output file '$output': $!"; + { + local $/ = undef; + $expected{$output} = <$fh>; + } + $fh->close; + } + + my $got = qx($blosxom_cgi $args); + + eq_or_diff($got, $expected{$output}, "$test - got expected output for args [$args]", { style => 'Unified' }); +} + +sub touch_files { + find( sub { + if (/^(.*)\.(\d+)$/) { + copy($_, $1); + `touch -t $2 $1`; + } + }, + shift ); +} diff --git a/t/driver.t b/t/driver.t deleted file mode 100755 index 36ae5ef..0000000 --- a/t/driver.t +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl - -use strict; -use warnings; - -use Test::More qw( no_plan ); - -use File::Copy; -use File::Compare; -use File::Find; -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 "$!"; - - touch_files (); - - 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; -} - - - -sub touch_files { - find( sub { - if (/^(.*)\.(\d+)$/) { - copy($_, $1); - `touch -t $2 $1`; - } - }, - "./data"); -} diff --git a/t/permalinks/config/blosxom.conf b/t/permalinks/config/blosxom.conf new file mode 100644 index 0000000..334ecc2 --- /dev/null +++ b/t/permalinks/config/blosxom.conf @@ -0,0 +1,2 @@ +$datadir = "$ENV{BLOSXOM_CONFIG_DIR}/../data"; +$blog_encoding = 'ISO-8859-1'; diff --git a/t/permalinks/data/foo/bar.txt b/t/permalinks/data/foo/bar.txt new file mode 100644 index 0000000..1e06cbd --- /dev/null +++ b/t/permalinks/data/foo/bar.txt @@ -0,0 +1,4 @@ +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. diff --git a/t/permalinks/data/foo/bar.txt.200607251102 b/t/permalinks/data/foo/bar.txt.200607251102 new file mode 100644 index 0000000..1e06cbd --- /dev/null +++ b/t/permalinks/data/foo/bar.txt.200607251102 @@ -0,0 +1,4 @@ +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. diff --git a/t/permalinks/data/foo/baz.txt b/t/permalinks/data/foo/baz.txt new file mode 100644 index 0000000..f946d24 --- /dev/null +++ b/t/permalinks/data/foo/baz.txt @@ -0,0 +1,8 @@ +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. diff --git a/t/permalinks/data/foo/baz.txt.200607251103 b/t/permalinks/data/foo/baz.txt.200607251103 new file mode 100644 index 0000000..f946d24 --- /dev/null +++ b/t/permalinks/data/foo/baz.txt.200607251103 @@ -0,0 +1,8 @@ +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. diff --git a/t/permalinks/expected.bar b/t/permalinks/expected.bar new file mode 100644 index 0000000..72d9ef6 --- /dev/null +++ b/t/permalinks/expected.bar @@ -0,0 +1,31 @@ +Content-Type: text/html; charset=ISO-8859-1 + + + + + + My Weblog + + + +
+ My Weblog
+ +
+

+

Tue, 25 Jul 2006

+

+ 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.
+
+ posted at: 11:02 | path: /foo | permanent link to this entry +

+ +

+

+ +
+ + diff --git a/t/permalinks/expected.html b/t/permalinks/expected.html new file mode 100644 index 0000000..cd79989 --- /dev/null +++ b/t/permalinks/expected.html @@ -0,0 +1,43 @@ +Content-Type: text/html; charset=ISO-8859-1 + + + + + + My Weblog + + + +
+ My Weblog
+ +
+

+

Tue, 25 Jul 2006

+

+ 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.
+
+ posted at: 11:03 | path: /foo | permanent link to this entry +

+

+ 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.
+
+ posted at: 11:02 | path: /foo | permanent link to this entry +

+ +

+

+ +
+ + diff --git a/t/permalinks/expected.rss b/t/permalinks/expected.rss new file mode 100644 index 0000000..1b076d4 --- /dev/null +++ b/t/permalinks/expected.rss @@ -0,0 +1,34 @@ +Content-Type: text/xml; charset=ISO-8859-1 + + + + + + + + My Weblog + http://localhost + Yet another Blosxom weblog. + en + + + Lorem ipsum + http://localhost/2006/07/19#1 + 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. + + + diff --git a/t/permalinks/spec.yaml b/t/permalinks/spec.yaml new file mode 100644 index 0000000..bec01ec --- /dev/null +++ b/t/permalinks/spec.yaml @@ -0,0 +1,18 @@ +tests: + - + - "" + - expected.html + - + - path=/foo + - expected.html +# GC: the following test fails because $path_info = test#bar, but via CGI the +# #bar is stripped by the CGI module. So I'm not sure what this is testing. +# - +# - path=/foo#bar +# - expected.html + - + - path=/foo/bar.html + - expected.bar +# - +# - path=/2006/07/25/bar.html +# - expected.bar diff --git a/t/plugin_dir/README b/t/plugin_dir/README new file mode 100644 index 0000000..24b3602 --- /dev/null +++ b/t/plugin_dir/README @@ -0,0 +1 @@ +Testing plugin loading via walking the standard $plugin_dir diff --git a/t/plugin_dir/spec.yaml b/t/plugin_dir/spec.yaml new file mode 100644 index 0000000..93883d3 --- /dev/null +++ b/t/plugin_dir/spec.yaml @@ -0,0 +1,4 @@ +tests: + - + - "" + - expected.html diff --git a/t/plugin_list/README b/t/plugin_list/README new file mode 100644 index 0000000..5b3536c --- /dev/null +++ b/t/plugin_list/README @@ -0,0 +1 @@ +Testing plugin loading via $plugin_list diff --git a/t/plugin_list/spec.yaml b/t/plugin_list/spec.yaml new file mode 100644 index 0000000..93883d3 --- /dev/null +++ b/t/plugin_list/spec.yaml @@ -0,0 +1,4 @@ +tests: + - + - "" + - expected.html diff --git a/t/smoketest/config/blosxom.conf b/t/smoketest/config/blosxom.conf new file mode 100644 index 0000000..334ecc2 --- /dev/null +++ b/t/smoketest/config/blosxom.conf @@ -0,0 +1,2 @@ +$datadir = "$ENV{BLOSXOM_CONFIG_DIR}/../data"; +$blog_encoding = 'ISO-8859-1'; diff --git a/t/smoketest/data/1.txt b/t/smoketest/data/1.txt new file mode 100644 index 0000000..ea2a941 --- /dev/null +++ b/t/smoketest/data/1.txt @@ -0,0 +1,16 @@ +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. diff --git a/t/smoketest/data/1.txt.200607192254 b/t/smoketest/data/1.txt.200607192254 new file mode 100644 index 0000000..ea2a941 --- /dev/null +++ b/t/smoketest/data/1.txt.200607192254 @@ -0,0 +1,16 @@ +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. diff --git a/t/smoketest/expected.html b/t/smoketest/expected.html new file mode 100644 index 0000000..0de1f33 --- /dev/null +++ b/t/smoketest/expected.html @@ -0,0 +1,43 @@ +Content-Type: text/html; charset=ISO-8859-1 + + + + + + My Weblog + + + +
+ My Weblog
+ +
+

+

Wed, 19 Jul 2006

+

+ 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.
+
+ posted at: 22:54 | path: | permanent link to this entry +

+ +

+

+ +
+ + diff --git a/t/smoketest/expected.rss b/t/smoketest/expected.rss new file mode 100644 index 0000000..4ea06ca --- /dev/null +++ b/t/smoketest/expected.rss @@ -0,0 +1,36 @@ +Content-Type: text/xml; charset=ISO-8859-1 + + + + + My Weblog + http://localhost/ + Yet another Blosxom weblog. + en + http://blogs.law.harvard.edu/tech/rss + blosxom/2.0.2 + + + Lorem ipsum + Wed, 19 Jul 2006 22:54:00 +1000 + http://localhost/2006/07/19#1 + + /1 + 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. + + + diff --git a/t/smoketest/spec.yaml b/t/smoketest/spec.yaml new file mode 100644 index 0000000..02f8989 --- /dev/null +++ b/t/smoketest/spec.yaml @@ -0,0 +1,7 @@ +tests: + - + - "" + - expected.html + - + - "flav=rss" + - "expected.rss" diff --git a/t/templates/config/blosxom.conf b/t/templates/config/blosxom.conf new file mode 100644 index 0000000..ae83e48 --- /dev/null +++ b/t/templates/config/blosxom.conf @@ -0,0 +1 @@ +$datadir = "$ENV{BLOSXOM_CONFIG_DIR}/../data"; diff --git a/t/templates/data/1.txt b/t/templates/data/1.txt new file mode 100644 index 0000000..ea2a941 --- /dev/null +++ b/t/templates/data/1.txt @@ -0,0 +1,16 @@ +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. diff --git a/t/templates/data/1.txt.200607192254 b/t/templates/data/1.txt.200607192254 new file mode 100644 index 0000000..ea2a941 --- /dev/null +++ b/t/templates/data/1.txt.200607192254 @@ -0,0 +1,16 @@ +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. diff --git a/t/templates/data/content_type.html b/t/templates/data/content_type.html new file mode 100644 index 0000000..e81f92a --- /dev/null +++ b/t/templates/data/content_type.html @@ -0,0 +1 @@ +text/xhtml; charset=UTF-8 diff --git a/t/templates/data/date.html b/t/templates/data/date.html new file mode 100644 index 0000000..2cdf76d --- /dev/null +++ b/t/templates/data/date.html @@ -0,0 +1 @@ +

$yr-$mo_num-$da

diff --git a/t/templates/data/foot.html b/t/templates/data/foot.html new file mode 100644 index 0000000..5179ade --- /dev/null +++ b/t/templates/data/foot.html @@ -0,0 +1,3 @@ + + + diff --git a/t/templates/data/head.html b/t/templates/data/head.html new file mode 100644 index 0000000..47130be --- /dev/null +++ b/t/templates/data/head.html @@ -0,0 +1,11 @@ + + + + + $blog_title $path_info_da $path_info_mo $path_info_yr + + + +

$blog_title

+

$path_info_da $path_info_mo $path_info_yr

diff --git a/t/templates/data/story.html b/t/templates/data/story.html new file mode 100644 index 0000000..7f3d068 --- /dev/null +++ b/t/templates/data/story.html @@ -0,0 +1,3 @@ +

$title

+
$body
+

posted at: $ti | path: $path | permanent link to this entry

diff --git a/t/templates/expected.html b/t/templates/expected.html new file mode 100644 index 0000000..2dd823b --- /dev/null +++ b/t/templates/expected.html @@ -0,0 +1,34 @@ +Content-Type: text/xhtml; charset=UTF-8 + + + + + + My Weblog + + + +

My Weblog

+

+

2006-07-19

+

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.
+

posted at: 22:54 | path: | permanent link to this entry

+ + + diff --git a/t/templates/expected.rss b/t/templates/expected.rss new file mode 100644 index 0000000..a03fc8a --- /dev/null +++ b/t/templates/expected.rss @@ -0,0 +1,34 @@ +Content-Type: text/xml; charset=ISO-8859-1 + + + + + + + + My Weblog + http://localhost/./blosxom.cgi + Yet another Blosxom weblog. + en + + + Lorem ipsum + http://localhost/./blosxom.cgi/2006/07/19#1 + 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. + + + diff --git a/t/templates/spec.yaml b/t/templates/spec.yaml new file mode 100644 index 0000000..93883d3 --- /dev/null +++ b/t/templates/spec.yaml @@ -0,0 +1,4 @@ +tests: + - + - "" + - expected.html