File: 90.ltpretty.t

package info (click to toggle)
liblatex-table-perl 1.0.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 784 kB
  • sloc: perl: 2,421; makefile: 2
file content (44 lines) | stat: -r--r--r-- 810 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use Test::More tests => 2;
use Test::NoWarnings;

use LaTeX::Table;

my $cmd = "$^X bin/ltpretty < t/ltpretty.txt";
my $output = `$cmd`;
my $expected_output =<< 'EOT'

 % theme=Meyrin;label=test;position=htb
 % Item:2c & Price
 % Gnat& per gram& 13.65
 % & each& 0.01
 % 
 % Gnu& stuffed& 92.59
 % Emu& stuffed& 33.33
 % Armadillo& frozen& 8.99

\begin{table}[htb]
\centering
\begin{tabular}{llr}
\toprule
\multicolumn{2}{c}{Item} & Price \\
\midrule
Gnat      & per gram & 13.65 \\
          & each     & 0.01  \\
\midrule
Gnu       & stuffed  & 92.59 \\
Emu       & stuffed  & 33.33 \\
Armadillo & frozen   & 8.99  \\
\bottomrule
\end{tabular}
\label{test}
\end{table}

EOT
;

is_deeply(
    [ split( "\n", $output ) ],
    [ split( "\n", $expected_output ) ],
    'ltpretty empty lines'
) || diag $output;