first commit
This commit is contained in:
36
perl/lib/Graph-Easy-0.76/t/as_txt.t
Normal file
36
perl/lib/Graph-Easy-0.76/t/as_txt.t
Normal file
@@ -0,0 +1,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');
|
||||
|
||||
Reference in New Issue
Block a user