File: 12_chaining.t

package info (click to toggle)
libtext-asciitable-perl 0.22-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 248 kB
  • sloc: perl: 923; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 445 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
#!/usr/bin/perl

BEGIN { $| = 1; print "1..3\n"; }
END {print "not ok 1\n" unless $loaded;}
use Text::ASCIITable;
$loaded = 1;
print "ok 1\n";
$i=2;
sub ok{print(shift()!=1?"not ok $i\n":"ok $i\n");$i++;}

$tmp = Text::ASCIITable->new({ chaining => 1 })
  ->setCols('One','Two','Three')
  ->addRow([
    [ 1, 2, 3 ],
    [ 4, 5, 6 ],
    [ 7, 8, 9 ],
    ])
  ->draw();
@arr = split(/\n/,$tmp);
ok(length($arr[0]) == 21);
ok(scalar(@arr) == 7);