From 7d1cc3a0209980bdbec59ffd0b6171898a1cc066 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 30 Aug 2010 13:35:50 -0400 Subject: add test for link(.) --- t/pagespec_match.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/pagespec_match.t b/t/pagespec_match.t index 97bcc969c..c14f6d052 100755 --- a/t/pagespec_match.t +++ b/t/pagespec_match.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 85; +use Test::More tests => 86; BEGIN { use_ok("IkiWiki"); } @@ -82,6 +82,7 @@ ok(! pagespec_match("foo.png", "page(foo*)"), "page() fails on non-page glob"); ok(pagespec_match("foo", "page(foo)"), "page() glob"); ok(pagespec_match("foo", "page(f*)"), "page() glob fail"); ok(pagespec_match("foo", "link(bar)"), "link"); +ok(pagespec_match("foo", "link(.)", location => "bar"), "link with ."); ok(pagespec_match("foo", "link(ba?)"), "glob link"); ok(! pagespec_match("foo", "link(quux)"), "failed link"); ok(! pagespec_match("foo", "link(qu*)"), "failed glob link"); -- cgit v1.2.3 From 2ec5efcd6c3da2c5f28d3a064b970c49778855b8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 30 Aug 2010 15:23:22 -0400 Subject: t/bazaar.t: Work around bzr 2.2.0's new requirement to configure bzr whoami before committing. --- debian/changelog | 2 ++ t/bazaar.t | 8 ++++++++ 2 files changed, 10 insertions(+) (limited to 't') diff --git a/debian/changelog b/debian/changelog index 53cff2970..df74e35d1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,8 @@ ikiwiki (3.20100816) UNRELEASED; urgency=low (intrigeri:) * po: Fix some bugs that affected l10n.ikiwiki.info's unusual setup. (intrigeri) + * t/bazaar.t: Work around bzr 2.2.0's new requirement to configure + bzr whoami before committing. -- Joey Hess Sun, 15 Aug 2010 11:45:48 -0400 diff --git a/t/bazaar.t b/t/bazaar.t index cd840fbe1..6e58f48f1 100755 --- a/t/bazaar.t +++ b/t/bazaar.t @@ -25,6 +25,14 @@ $config{srcdir} = "$dir/repo"; IkiWiki::loadplugins(); IkiWiki::checkconfig(); +# XXX +# This is a workaround for bzr's new requirement that bzr whoami be run +# before committing. This makes the test suite work with an unconfigured +# bzr, but ignores the need to have a properly configured bzr before +# using ikiwiki with bzr. +$ENV{HOME}=$dir; +system 'bzr whoami test@example.com'; + system "bzr init $config{srcdir}"; use CGI::Session; -- cgit v1.2.3 From 82f9be09607e82cc8e00b50f20e5dd639897a333 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 30 Aug 2010 15:27:06 -0400 Subject: add test case for link(.) with omitted location --- t/pagespec_match.t | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't') diff --git a/t/pagespec_match.t b/t/pagespec_match.t index c14f6d052..fe9624370 100755 --- a/t/pagespec_match.t +++ b/t/pagespec_match.t @@ -1,7 +1,7 @@ #!/usr/bin/perl use warnings; use strict; -use Test::More tests => 86; +use Test::More tests => 87; BEGIN { use_ok("IkiWiki"); } @@ -83,6 +83,7 @@ ok(pagespec_match("foo", "page(foo)"), "page() glob"); ok(pagespec_match("foo", "page(f*)"), "page() glob fail"); ok(pagespec_match("foo", "link(bar)"), "link"); ok(pagespec_match("foo", "link(.)", location => "bar"), "link with ."); +ok(! pagespec_match("foo", "link(.)"), "link with . but missing location"); ok(pagespec_match("foo", "link(ba?)"), "glob link"); ok(! pagespec_match("foo", "link(quux)"), "failed link"); ok(! pagespec_match("foo", "link(qu*)"), "failed glob link"); -- cgit v1.2.3 From 78e89acf370cd456b64a163cc1963362c14ebe28 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 15 Sep 2010 15:38:06 -0400 Subject: update test --- t/permalink.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 't') diff --git a/t/permalink.t b/t/permalink.t index adb8648b4..81d4d1820 100755 --- a/t/permalink.t +++ b/t/permalink.t @@ -8,6 +8,6 @@ ok(! system("make -s ikiwiki.out")); ok(! system("perl -I. ./ikiwiki.out -plugin inline -url=http://example.com -cgiurl=http://example.com/ikiwiki.cgi -rss -atom -underlaydir=underlays/basewiki -set underlaydirbase=underlays -templatedir=templates t/tinyblog t/tmp/out")); # This guid should never, ever change, for any reason whatsoever! my $guid="http://example.com/post/"; -ok(length `grep '$guid' t/tmp/out/index.rss`); -ok(length `grep '$guid' t/tmp/out/index.atom`); +ok(length `egrep '$guid' t/tmp/out/index.rss`); +ok(length `egrep '$guid' t/tmp/out/index.atom`); ok(! system("rm -rf t/tmp t/tinyblog/.ikiwiki")); -- cgit v1.2.3 From 2df92a956af2ed6b4ac3c2c3de01c56bb08e2368 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 29 Sep 2010 11:58:45 -0400 Subject: Fix test suite failure on other side of date line. --- debian/changelog | 6 ++++++ t/pagespec_match.t | 1 + 2 files changed, 7 insertions(+) (limited to 't') diff --git a/debian/changelog b/debian/changelog index a26a35617..527dd7884 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.20100927) UNRELEASED; urgency=low + + * Fix test suite failure on other side of date line. + + -- Joey Hess Wed, 29 Sep 2010 11:58:23 -0400 + ikiwiki (3.20100926) unstable; urgency=low * meta: Ensure that the url specified by xrds-location is absolute. diff --git a/t/pagespec_match.t b/t/pagespec_match.t index fe9624370..a37b06e8e 100755 --- a/t/pagespec_match.t +++ b/t/pagespec_match.t @@ -101,6 +101,7 @@ ok(pagespec_match("ook", "link(blog/tags/foo)"), "link internal absolute success ok(pagespec_match("ook", "link(/blog/tags/foo)"), "link explicit absolute success"); ok(pagespec_match("meh", "!link(done)"), "negated failing match is a success"); +$ENV{TZ}="GMT"; $IkiWiki::pagectime{foo}=1154532692; # Wed Aug 2 11:26 EDT 2006 $IkiWiki::pagectime{bar}=1154532695; # after ok(pagespec_match("foo", "created_before(bar)")); -- cgit v1.2.3 From fcf0ee574a974ca482509da595cdf9196a3afbb3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 16 Nov 2010 16:48:42 -0400 Subject: add test case for RSS url munging --- t/rssurls.t | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 t/rssurls.t (limited to 't') diff --git a/t/rssurls.t b/t/rssurls.t new file mode 100755 index 000000000..870770496 --- /dev/null +++ b/t/rssurls.t @@ -0,0 +1,37 @@ +#!/usr/bin/perl +use warnings; +use strict; +use Test::More tests => 13; + +BEGIN { use_ok("IkiWiki::Plugin::inline"); } + +# Test the absolute_urls function, used to fix up relative urls for rss +# feeds. +sub test { + my $input=shift; + my $baseurl=shift; + my $expected=shift; + $expected=~s/URL/$baseurl/g; + is(IkiWiki::absolute_urls($input, $baseurl), $expected); + # try it with single quoting -- it's ok if the result comes back + # double or single-quoted + $input=~s/"/'/g; + my $expected_alt=$expected; + $expected_alt=~s/"/'/g; + my $ret=IkiWiki::absolute_urls($input, $baseurl); + ok(($ret eq $expected) || ($ret eq $expected_alt), "$ret vs $expected"); +} + +sub unchanged { + test($_[0], $_[1], $_[0]); +} + +my $url="http://example.com/blog/foo/"; +unchanged("foo", $url); +unchanged('', $url, ); +test('', $url, ''); +test('', $url, ''); +test('', $url, ''); +test('', $url, ''); +# off until bug #603736 is fixed +#test('