8 my $installed = $ENV{INSTALLED_TESTS};
12 @command = qw(ikiwiki);
15 ok(! system("make -s ikiwiki.out"));
16 @command = ("perl", "-I".getcwd, qw(./ikiwiki.out
17 --underlaydir=underlays/basewiki
18 --set underlaydirbase=underlays
19 --templatedir=templates));
22 push @command, qw(--set usedirs=0 --plugin table
23 --url=http://example.com --cgiurl=http://example.com/ikiwiki.cgi
24 t/tmp/in t/tmp/out --verbose);
28 ok(! system("rm -rf t/tmp"));
29 ok(! system("mkdir t/tmp"));
35 writefile($name, "t/tmp/in", $content);
36 ok(utime(333333333, 333333333, "t/tmp/in/$name"));
39 write_old_file("csv.mdwn",
40 '[[!table format="csv" data="""
45 write_old_file("dsv.mdwn",
46 '[[!table format="dsv" data="""
52 ok(! system(@command));
53 ok(! system(@command, "--refresh"));
55 $blob = readfile("t/tmp/out/dsv.html");
56 like($blob, qr{<th>\s*Key\s*</th>.*<th>\s*Value\s*</th>}s);
57 like($blob, qr{<td>\s*ASCII\s*</td>.*<td>\s*hello\s*</td>}s);
58 like($blob, qr{<td>\s*Not ASCII\s*</td>.*<td>\s*¬\s*</td>}s);
61 skip "Text::CSV unavailable", 0 unless eval q{use Text::CSV; 1};
63 $blob = readfile("t/tmp/out/csv.html");
64 like($blob, qr{<th>\s*Key\s*</th>.*<th>\s*Value\s*</th>}s);
65 like($blob, qr{<td>\s*ASCII\s*</td>.*<td>\s*hello\s*</td>}s);
66 like($blob, qr{<td>\s*Not ASCII\s*</td>.*<td>\s*¬\s*</td>}s);