File: 17_Tree_Simple_width_test.t

package info (click to toggle)
libtree-simple-perl 1.33-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 328 kB
  • sloc: perl: 1,843; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 574 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
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl

use strict;
use warnings;

use Test::More tests => 3;

BEGIN {
	use_ok('Tree::Simple');
};

# -------------------------

my $n0 = Tree::Simple->new("0");
my $n00= Tree::Simple->new("0");
my $n01= Tree::Simple->new("0");
my $n02= Tree::Simple->new("0");
my $n03= Tree::Simple->new("0");

$n0->addChild($n00);
$n0->addChildren(($n01, $n02, $n03));

#diag 'Auto width: ', $n0->getWidth();

is($n0 -> getWidth, 4, 'Auto-calculated width is correct');

$n0->fixWidth();

#diag 'Fixed width: ', $n0->getWidth();

is($n0 -> getWidth, 4, 'Fixed width is correct');