1#!/usr/bin/perl -w
2
3use Test::More;
4use strict;
5
6BEGIN
7   {
8   plan tests => 4;
9   chdir 't' if -d 't';
10   use lib '../lib';
11   use_ok ("Graph::Easy") or die($@);
12   };
13
14can_ok ("Graph::Easy", qw/
15  as_txt
16  /);
17
18#############################################################################
19# as_txt
20
21use Graph::Easy::Parser;
22
23my $parser = Graph::Easy::Parser->new();
24
25my $graph = $parser->from_text(
26  "[A] { link: http://foo.com; color: red; origin: B; offset: 2,1; }"
27  );
28
29is ($parser->error(), '', 'no parsing error' );
30is ($graph->as_txt(), <<EOF
31[ A ] { color: red; link: http://foo.com; offset: 2,1; origin: B; }
32
33[ B ]
34EOF
35, 'as_txt with offset and origin');
36
37