From f0c76aa51ca7a1dbfb8fcfa679baa114e563b895 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sun, 21 Dec 2008 16:37:20 +0000 Subject: Add a regression test for &openiduser --- t/openiduser.t | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 t/openiduser.t (limited to 't/openiduser.t') diff --git a/t/openiduser.t b/t/openiduser.t new file mode 100755 index 000000000..fe4d2b445 --- /dev/null +++ b/t/openiduser.t @@ -0,0 +1,30 @@ +#!/usr/bin/perl +use warnings; +use strict; + +BEGIN { + eval q{ + use Net::OpenID::VerifiedIdentity; + }; + if ($@) { + eval q{use Test::More skip_all => "Net::OpenID::VerifiedIdentity not available"}; + } + else { + eval q{use Test::More tests => 9}; + } + use_ok("IkiWiki::Plugin::openid"); +} + +# Some typical examples: + +is(IkiWiki::openiduser('http://josephturian.blogspot.com'), 'josephturian [blogspot.com]'); +is(IkiWiki::openiduser('http://yam655.livejournal.com/'), 'yam655 [livejournal.com]'); +is(IkiWiki::openiduser('http://id.mayfirst.org/jamie/'), 'jamie [id.mayfirst.org]'); + +# and some less typical ones taken from the ikiwiki commit history + +is(IkiWiki::openiduser('http://thm.id.fedoraproject.org/'), 'thm [id.fedoraproject.org]'); +is(IkiWiki::openiduser('http://dtrt.org/'), 'dtrt.org'); +is(IkiWiki::openiduser('http://alcopop.org/me/openid/'), 'openid [alcopop.org/me]'); +is(IkiWiki::openiduser('http://id.launchpad.net/882/bielawski1'), 'bielawski1 [id.launchpad.net/882]'); +is(IkiWiki::openiduser('http://technorati.com/people/technorati/drajt'), 'drajt [technorati.com/people/technorati]'); -- cgit v1.2.3 From 13d77c369e5c2856fad78e48b0e39e4e76d1d5aa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 21 Dec 2008 13:46:00 -0500 Subject: avoid an uninitialized value warning --- t/openiduser.t | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 't/openiduser.t') diff --git a/t/openiduser.t b/t/openiduser.t index fe4d2b445..52d879484 100755 --- a/t/openiduser.t +++ b/t/openiduser.t @@ -17,7 +17,14 @@ BEGIN { # Some typical examples: +# This test, when run by Test::Harness using perl -w, exposes a warning in +# Net::OpenID::VerifiedIdentity. Normally that warning is not displayed, as +# that module does not use warnings. To avoid cluttering the test output, +# disable the -w switch temporarily. +$^W=0; is(IkiWiki::openiduser('http://josephturian.blogspot.com'), 'josephturian [blogspot.com]'); +$^W=1; + is(IkiWiki::openiduser('http://yam655.livejournal.com/'), 'yam655 [livejournal.com]'); is(IkiWiki::openiduser('http://id.mayfirst.org/jamie/'), 'jamie [id.mayfirst.org]'); -- cgit v1.2.3