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="""
51 write_old_file("jon.mdwn",
52 '(See doc/bugs/table_can_not_deal_with_Chinese.mdwn)
54 [[!table class=fullwidth_table delimiter=" " data="""
55 Number Title Own? Read?
56 I (HB1), 70 (PB1), 5 (PB50) Dune O ✓"""]]');
58 ok(! system(@command));
59 ok(! system(@command, "--refresh"));
61 $blob = readfile("t/tmp/out/dsv.html");
62 like($blob, qr{<th>\s*Key\s*</th>.*<th>\s*Value\s*</th>}s);
63 like($blob, qr{<td>\s*ASCII\s*</td>.*<td>\s*hello\s*</td>}s);
64 like($blob, qr{<td>\s*Not ASCII\s*</td>.*<td>\s*¬\s*</td>}s);
67 skip "Text::CSV unavailable", 0 unless eval q{use Text::CSV; 1};
69 $blob = readfile("t/tmp/out/jon.html");
70 like($blob, qr{<th>\s*Number\s*</th>\s*<th>\s*Title\s*</th>\s*<th>\s*Own\?\s*</th>\s*<th>\s*Read\?\s*</th>}s);
71 like($blob, qr{<td>\s*I \(HB1\), 70 \(PB1\), 5 \(PB50\)\s*</td>\s*<td>\s*Dune\s*</td>\s*<td>\s*O\s*</td>\s*<td>\s*✓\s*</td>}s);
73 $blob = readfile("t/tmp/out/csv.html");
74 like($blob, qr{<th>\s*Key\s*</th>.*<th>\s*Value\s*</th>}s);
75 like($blob, qr{<td>\s*ASCII\s*</td>.*<td>\s*hello\s*</td>}s);
76 like($blob, qr{<td>\s*Not ASCII\s*</td>.*<td>\s*¬\s*</td>}s);