File: calls.pl

package info (click to toggle)
libdata-showtable-perl 4.6-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,032 kB
  • sloc: perl: 2,221; sh: 38; makefile: 7
file content (66 lines) | stat: -rwxr-xr-x 1,296 bytes parent folder | download | duplicates (3)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env perl

# Test calling sequences.
# set $showSub or default to 'ShowBoxTable'.

use Data::ShowTable;
require 'Test-Setup.pl';

sub start_tests($);
sub run_test($&);

$showSub = \&ShowBoxTable unless $showSub ne '';

start_tests 8;

run_test 1, sub { 
    &$showSub(\@Titles, \@Types, \@Widths, \&showDataRow); 
};

run_test 2, sub { 
    &$showSub(\@Titles, \@Types, \@Widths, \&showDataRow, \&ShowTableValue); 
};

run_test 3, sub { 
    &$showSub(\@Titles, \@Types, \@Widths, \&showDataRow, \&ShowTableValue, 80); 
};

run_test 4, sub { 
    &$showSub(\@Titles, \@Types, \@Widths, \&showDataRow, '', 80); 
};

run_test 5, sub { 
    &$showSub({	titles => \@Titles, 
		types  => \@Types, 
		widths => \@Widths,
		row_sub => \&showDataRow,
	      });
};

run_test 6, sub { 
    &$showSub({	titles => \@Titles, 
		types  => \@Types, 
		widths => \@Widths,
		row_sub => \&showDataRow,
		fmt_sub => \&ShowTableValue,
	      });
};

run_test 7, sub { 
    &$showSub({	titles => \@Titles, 
		types  => \@Types, 
		widths => \@Widths,
		row_sub => \&showDataRow,
		fmt_sub => \&ShowTableValue,
		max_width => 80,
	      });
};

run_test 8, sub { 
    &$showSub({	titles => \@Titles, 
		types  => \@Types, 
		widths => \@Widths,
		row_sub => \&showDataRow,
		max_width => 80,
	      });
};