File: as_txt.t

package info (click to toggle)
libgraph-easy-perl 0.76-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 4,264 kB
  • sloc: perl: 23,869; makefile: 7
file content (36 lines) | stat: -rw-r--r-- 669 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
29
30
31
32
33
34
35
36
#!/usr/bin/perl -w

use Test::More;
use strict;

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

can_ok ("Graph::Easy", qw/
  as_txt
  /);

#############################################################################
# as_txt

use Graph::Easy::Parser;

my $parser = Graph::Easy::Parser->new();

my $graph = $parser->from_text(
  "[A] { link: http://foo.com; color: red; origin: B; offset: 2,1; }"
  );

is ($parser->error(), '', 'no parsing error' );
is ($graph->as_txt(), <<EOF
[ A ] { color: red; link: http://foo.com; offset: 2,1; origin: B; }

[ B ]
EOF
, 'as_txt with offset and origin');