File: 16.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 (30 lines) | stat: -rw-r--r-- 548 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
#!/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-1537151

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

BEGIN {
    plan tests => 1;
}

my @data = (
    [0, "c"],
    ["d", "e"],
    [0, 0],
    [0, "f"],
);

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