File: text.t

package info (click to toggle)
libgraph-easy-as-svg-perl 0.28-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 304 kB
  • sloc: perl: 1,924; makefile: 7
file content (28 lines) | stat: -rw-r--r-- 598 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env perl

# test the text_ength() function

use Test::More;
use strict;
use utf8;

BEGIN
   {
   plan tests => 7;
   chdir 't' if -d 't';
   use lib '../lib';
   use_ok ("Graph::Easy") or die($@);
   use_ok ("Graph::Easy::As_svg") or die($@);
   };

#############################################################################

my $l = 'Graph::Easy::As_svg::_text_length';

no strict 'refs';

is ($l->(14, 'ABCDE'), 3.6, 'ABCDE is 3.6 long');
is ($l->(14, 'WW'), 0.9*2, 'WW');
is ($l->(14, 'ii'), 0.33*2, 'ii');
is ($l->(14, '@@'), 1.15*2, '@@');
is ($l->(14, 'ææ'), 1.25*2, 'ææ');