]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - t/meta.t
3.20161229.1~bpo8+1
[git.ikiwiki.info.git] / t / meta.t
index ab25c2f83b1c29e3c7ece69e6704ebf95d330273..3b26ee7d2c48f11f0120d3b5935bac13d3c1811c 100755 (executable)
--- a/t/meta.t
+++ b/t/meta.t
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 use warnings;
 use strict;
+use Cwd qw(getcwd);
 use Test::More;
 use IkiWiki;
 
@@ -8,10 +9,21 @@ my $tmp = 't/tmp';
 my $srcdir = "$tmp/in";
 my $destdir = "$tmp/out";
 
-my @command = (qw(./ikiwiki.out --plugin meta --disable-plugin htmlscrubber));
-push @command, qw(-underlaydir=underlays/basewiki);
-push @command, qw(-set underlaydirbase=underlays);
-push @command, qw(--templatedir=templates);
+my $installed = $ENV{INSTALLED_TESTS};
+
+my @command;
+if ($installed) {
+       @command = qw(ikiwiki);
+}
+else {
+       ok(! system("make -s ikiwiki.out"));
+       @command = ("perl", "-I".getcwd, qw(./ikiwiki.out
+               --underlaydir=underlays/basewiki
+               --set underlaydirbase=underlays
+               --templatedir=templates));
+}
+
+push @command, qw(--plugin meta --disable-plugin htmlscrubber);
 push @command, $srcdir, $destdir;
 
 sub write_build_read_compare {
@@ -125,12 +137,11 @@ write_build_read_compare(
 #      qr{<link href="http://wonka\.link\.example" />},
 #);
 
-# XXX buggy? is this my bug? maybe twitter:foo would just work if this worked
-#write_build_read_compare(
-#      'name',
-#      q{[[!meta name="thingy" value1="hi" value2="hello"]]},
-#      qr{<meta name="thingy" value1="hi" value2="hello" />},
-#);
+write_build_read_compare(
+       'name',
+       q{[[!meta name="thingy" value1="hi" value2="hello"]]},
+       qr{<meta name="thingy" value[0-9]{1}=".+?" value[0-9]{1}=".+?" />},
+);
 
 write_build_read_compare(
        'keywords',
@@ -149,11 +160,11 @@ write_build_read_compare(
 #      '[[!meta twitter:card="player"]]',
 #      qr{<meta name="twitter:card" content="player" />},
 #);
-#
-#write_build_read_compare(
-#      'twittercard2',
-#      '[[!meta name="twitter:card" content="player"]]',
-#      qr{<meta name="twitter:card" content="player" />},
-#);
+
+write_build_read_compare(
+       'twittercard2',
+       '[[!meta name="twitter:card" content="player"]]',
+       qr{<meta name="twitter:card" content="player" />},
+);
 
 done_testing();