File: 40.miscprivates.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 (28 lines) | stat: -r--r--r-- 932 bytes parent folder | download | duplicates (6)
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
use Test::More tests => 4;
use Test::NoWarnings;
use strict;
use warnings;

use LaTeX::Table;
use English qw( -no_match_vars ) ;

my $table = LaTeX::Table->new({ filename => 'out.tex',
							    label    => 'beercounter',
								maincaption => 'Beer Counter',
								caption   => 'Number of beers before and after 4pm.',
                             });

my $test_data = [ [ 1, 2, 4], [ 2, 3 ] ];
$table->_calc_data_summary($test_data);
my $summary = $table->_get_data_summary();
is_deeply($summary, ['NUMBER','NUMBER','NUMBER'], 'all integers');

$test_data = [ [ 'a', 2, 4], [ 'b', 3 ] ];
$table->_calc_data_summary($test_data);
$summary = $table->_get_data_summary();
is_deeply($summary, ['DEFAULT','NUMBER','NUMBER'], 'not all integers');

$test_data = [ [ 'a', 2, ], [ '1', 3 ] ];
$table->_calc_data_summary($test_data);
$summary = $table->_get_data_summary();
is_deeply($summary, ['DEFAULT','NUMBER'], 'not all integers');