File: 17.t

package info (click to toggle)
libtext-tabulardisplay-perl 1.38-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: perl: 766; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 608 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/perl
# vim: set ft=perl:
# Test suggested by Patrick Kuijvenhoven <https://github.com/petski>
# in https://github.com/dlc/text--tabulardisplay/commit/4b9bd105d9ebaf8ac838e8e993216e4b56d85683#commitcomment-1540416

use strict;
use Text::TabularDisplay;
use Test;

BEGIN {
    plan tests => 1;
}

my @data = (
    ["a", "b"],
    ["", ""],
    [undef, ""],
    ["", undef],
    [undef, undef],
    [0, 0],
);

my $t = Text::TabularDisplay->new("a", "b");
$t->populate([ @data ]);
ok($t->render, "+---+---+
| a | b |
+---+---+
| a | b |
|   |   |
|   |   |
|   |   |
|   |   |
| 0 | 0 |
+---+---+");