Commits

Shlomi Fish committed 9b367d3

Start to convert away from unordered keys.

To make it eventually pass on on perl-5.18.0.

  • Participants
  • Parent commits b71cecb

Comments (0)

Files changed (36)

Graph-Easy/lib/Graph/Easy.pm

   # *  likewise for "node.subclass", attribute names never have a "." in them
   $self->{att} = {};
 
-  foreach my $k (keys %$args)
+  foreach my $k (sort keys %$args)
     {
     if ($k !~ /^(timeout|debug|strict|fatal_errors|undirected)\z/)
       {
   return $self->error ("Illegal class '$class_selector' when trying to set attributes")
     if @classes == 0;
 
-  foreach my $a (keys %$att)
+  foreach my $a (sort keys %$att)
     {
     for my $class (@classes)
       {
 
     # make a copy from $self->{att} to $a:
 
-    for my $class (keys %{$self->{att}})
+    for my $class (sort keys %{$self->{att}})
       {
       my $ac = $self->{att}->{$class};
       $a->{$class} = {};
       my $acc = $a->{$class};
-      for my $k (keys %$ac)
+      for my $k (sort keys %$ac)
         {
         $acc->{$k} = $ac->{$k};
         }
       }
 
     # add the extra keys
-    for my $class (keys %$overlay)
+    for my $class (sort keys %$overlay)
       {
       my $oc = $overlay->{$class};
       # create the hash if it doesn't exist yet
       $a->{$class} = {} unless ref $a->{$class};
       my $acc = $a->{$class};
-      for my $k (keys %$oc)
+      for my $k (sort keys %$oc)
         {
         $acc->{$k} = $oc->{$k} unless exists $acc->{$k};
         }
   my $css = '';
   foreach my $class (sort keys %$a)
     {
-    next if keys %{$a->{$class}} == 0;			# skip empty ones
+    next if (not %{$a->{$class}});			# skip empty ones
 
     my $c = $class; $c =~ s/\./_/g;			# node.city => node_city
 
   my $min_x = undef;
 
   # find all x and y occurances to sort them by row/columns
-  for my $k (keys %$cells)
+  for my $k (sort keys %$cells)
     {
     my ($x,$y) = split/,/, $k;
     my $node = $cells->{$k};
   my $new = Graph::Easy->new();
 
   # clone all the settings
-  for my $k (keys %$self)
+  for my $k (sort keys %$self)
     {
     $new->{$k} = $self->{$k} unless ref($self->{$k});
     }
 
-  for my $g (keys %{$self->{groups}})
+  for my $g (sort keys %{$self->{groups}})
     {
     my $ng = $new->add_group($g);
     # clone the attributes
 
   my $out = { };
 
-  for my $k (keys %$in)
+  for my $k (sort keys %$in)
     {
     if (ref($k) eq 'HASH')
       {

Graph-Easy/lib/Graph/Easy/As_graphviz.pm

   my ($self, $out) = @_;
 
   my $att = '';
-  for my $atr (keys %$out)
+  for my $atr (sort keys %$out)
     {
     my $v = $out->{$atr};
     $v =~ s/\n/\\n/g;
   $att;
   }
 
+use Graph::Easy::Util qw(first_kv);
+
 sub _generate_group_edge
   {
   # Given an edge (from/to at least one group), generate the graphviz code
   if ($from->isa('Graph::Easy::Group'))
     {
     # find an arbitray node inside the group
-    my ($n, $v) = each %{$from->{nodes}};
-    
+        my ($n, $v) = first_kv($from->{nodes});
+
     $a = 'ltail="cluster' . $from->{id}.'"';	# ltail=cluster0
     $from = $v;
     }
   if ($to->isa('Graph::Easy::Group'))
     {
     # find an arbitray node inside the group
-    my ($n, $v) = each %{$to->{nodes}};
-    
+    my ($n, $v) = first_kv($to->{nodes});
+
     $b = 'lhead="cluster' . $to->{id}.'"';	# lhead=cluster0
     $to = $v;
     }
     my $copy = {};
     my $attribs = $group->get_attributes();
 
-    for my $a (keys %$attribs)
+    for my $key (sort keys %$attribs)
       {
-      $copy->{$a} = $attribs->{$a};
+      $copy->{$key} = $attribs->{$key};
       }
     # set some defaults
     $copy->{'borderstyle'} = 'solid' unless defined $copy->{'borderstyle'};

Graph-Easy/lib/Graph/Easy/As_txt.pm

     my $names = {};
     for my $child ($self, @$parts)
       {
-      for my $k (keys %{$child->{att}})
+      for my $k (sort keys %{$child->{att}})
         {
         $names->{$k} = undef;
         }
       }
 
-    for my $k (keys %$names)
+    for my $k (sort keys %$names)
       {
       next if $k eq 'basename';
       my $val = $self->{att}->{$k};

Graph-Easy/lib/Graph/Easy/Attributes.pm

 {
   # reverse mapping "#ff0000 => 'red'"
   # also build a list of all possible color names
-  for my $n (keys %$color_names)
+  for my $n (sort keys %$color_names)
     {
     my $s = $color_names->{$n};
     $color_values->{ $n } = {};
   # the caller must filter them out.
 
   # do these attributes
-  my @keys = keys %$att;
+  my @keys = sort keys %$att;
 
   my $color_scheme = 'w3c';
   $color_scheme = $object->attribute('colorscheme') if ref($object);
         }
       }
 
-    for my $at (keys %$temp)
+    for my $at (sort keys %$temp)
       {
       my $v = $temp->{$at};
 
   my $out = {};
   if (!$g->{strict})
     {
-    for my $name (keys %$att)
+    for my $name (sort keys %$att)
       {
       my $val = $att->{$name};
       next unless defined $val;			# set to undef?
     }
 
   my $base_class = $class; $base_class =~ s/\..*//;
-  for my $name (keys %$att)
+  for my $name (sort keys %$att)
     {
     my $val = $att->{$name};
     next unless defined $val;			# set to undef?
   # f.i. "all", "node"
   for my $type ('all', $class)
     {
-    for my $a (keys %{$attributes->{$type}})
+    for my $a (sort keys %{$attributes->{$type}})
       {
       my $val = $self->attribute($a);		# respect inheritance	
       $att->{$a} = $val if defined $val;
 
   my $att = {};
 
-  for my $key (keys %{$self->{att}})
+  for my $key (sort keys %{$self->{att}})
     {
     $att->{$key} = $self->{att}->{$key};
     }

Graph-Easy/lib/Graph/Easy/Edge.pm

   # leave this unitialized until we need it
   # $self->{cells} = [ ];
 
-  foreach my $k (keys %$args)
+  foreach my $k (sort keys %$args)
     {
     if ($k !~ /^(label|name|style)\z/)
       {

Graph-Easy/lib/Graph/Easy/Edge/Cell.pm

   $self->{w} = undef;
   $self->{h} = 3;
 
-  foreach my $k (keys %$args)
+  foreach my $k (sort keys %$args)
     {
     # don't store "after" and "before"
     next unless $k =~ /^(graph|edge|x|y|type)\z/;

Graph-Easy/lib/Graph/Easy/Group.pm

 #  $self->{cx} = 1;
 #  $self->{cy} = 1;
 
-  foreach my $k (keys %$args)
+  foreach my $k (sort keys %$args)
     {
     if ($k !~ /^(graph|name)\z/)
       {

Graph-Easy/lib/Graph/Easy/Group/Cell.pm

   $self->{cell_class} = ' gi';
   $self->{name} = '';
   
-  $self->{x} = 0;
-  $self->{y} = 0;
+  $self->{'x'} = 0;
+  $self->{'y'} = 0;
 
   # XXX TODO check arguments
-  foreach my $k (keys %$args)
+  foreach my $k (sort keys %$args)
     {
     $self->{$k} = $args->{$k};
     }

Graph-Easy/lib/Graph/Easy/Layout.pm

 
     if (scalar keys %suc == 1)		# have only one unique successor?
       {
-      my $s = $suc{ each %suc };
+          my ($key) = keys(%suc);
+      my $s = $suc{ $key };
 
       if (!defined $s->{_chain})	# chain already done?
         {

Graph-Easy/lib/Graph/Easy/Layout/Chain.pm

   # Generic init routine, to be overriden in subclasses.
   my ($self,$args) = @_;
   
-  foreach my $k (keys %$args)
+  foreach my $k (sort keys %$args)
     {
     if ($k !~ /^(start|graph)\z/)
       {

Graph-Easy/lib/Graph/Easy/Layout/Path.pm

   $placed;
   }
 
+use Graph::Easy::Util qw(first_kv);
+
 sub _find_node_place
   {
   # Try to place a node (or node cluster). Return score (usually 0).
   # if the node has outgoing edges (which might be shared)
   if (!ref($edge))
     {
-    (undef,$edge) = each %{$node->{edges}} if keys %{$node->{edges}} > 0;
+    (undef,$edge) = first_kv($node->{edges}) if keys %{$node->{edges}} > 0;
     }
 
   my $dir = undef; $dir = $edge->flow() if ref($edge);

Graph-Easy/lib/Graph/Easy/Layout/Repair.pm

   # is O(N) where N is the number of actually existing cells. Otherwise we
   # would have to create the full table-layout, and then insert rows/columns.
   my $cells = {};
-  for my $key (keys %$cells_layout)
+  for my $key (sort keys %$cells_layout)
     {
     my ($x,$y) = split /,/, $key;
     my $cell = $cells_layout->{$key};

Graph-Easy/lib/Graph/Easy/Layout/Scout.pm

   $max_x = -10000000;
   $max_y = -10000000;
 
-  for my $c (keys %$cells)
+  for my $c (sort keys %$cells)
     {
     my ($x,$y) = split /,/, $c;
     $min_x = $x if $x < $min_x;

Graph-Easy/lib/Graph/Easy/Node.pm

   $self->{att} = { };
   $self->{class} = 'node';		# default class
 
-  foreach my $k (keys %$args)
+  foreach my $k (sort keys %$args)
     {
     if ($k !~ /^(label|name)\z/)
       {
   {
   my ($self, $atr, $index) = @_;
 
-  foreach my $n (keys %$atr)
+  foreach my $n (sort keys %$atr)
     {
     my $val = $atr->{$n};
     $val = $val->[$index] if ref($val) eq 'ARRAY' && defined $index;

Graph-Easy/lib/Graph/Easy/Node/Cell.pm

   $self->{class} = '';
   $self->{name} = '';
   
-  $self->{x} = 0;
-  $self->{y} = 0;
+  $self->{'x'} = 0;
+  $self->{'y'} = 0;
 
   # default: belongs to no node
   $self->{node} = undef;
 
-  foreach my $k (keys %$args)
+  foreach my $k (sort keys %$args)
     {
     if ($k !~ /^(node|graph|x|y)\z/)
       {

Graph-Easy/lib/Graph/Easy/Parser.pm

   $self->{debug} = 0;
   $self->{fatal_errors} = 1;
   
-  foreach my $k (keys %$args)
+  foreach my $k (sort keys %$args)
     {
     if ($k !~ /^(debug|fatal_errors)\z/)
       {
 	{
 	# stack is a scope stack
 	# XXX TODO: Find out wether the attribute goes to graph, node or edge
-	for my $k (keys %$a)
+	for my $k (sort keys %$a)
 	  {
 	  $stack->[-1]->{graph}->{$k} = $a->{$k};
 	  }
   my $uc = $self->{use_class};
 
   # instruct the graph to use the custom classes, too
-  for my $o (keys %$uc)
+  for my $o (sort keys %$uc)
     {
     $graph->use_class($o, $uc->{$o}) unless $o eq 'graph';	# group, node and edge
     }

Graph-Easy/lib/Graph/Easy/Parser/Graphviz.pm

     my $old_scope = $self->{scope_stack}->[-1];
 
     # make a copy of the old scope's attributes
-    for my $t (keys %$old_scope)
+    for my $t (sort keys %$old_scope)
       {
       next if $t =~ /^_/;
       my $s = $old_scope->{$t};
       $scope->{$t} = {} unless ref $scope->{$t}; my $sc = $scope->{$t};
-      for my $k (keys %$s)
+      for my $k (sort keys %$s)
         {
 	# skip things like "_is_group"
         $sc->{$k} = $s->{$k} unless $k =~ /^_/;
 	my $scope = $self->{scope_stack}->[-1];
         $scope->{$type} = {} unless ref $scope->{$type};
 	my $s = $scope->{$type};
-	for my $k (keys %$att)
+	for my $k (sort keys %$att)
 	  {
           $s->{$k} = $att->{$k}; 
 	  }

Graph-Easy/lib/Graph/Easy/Parser/VCG.pm

     my $old_scope = $self->{scope_stack}->[-1];
 
     # make a copy of the old scope's attribtues
-    for my $t (keys %$old_scope)
+    for my $t (sort keys %$old_scope)
       {
       next if $t =~ /^_/;
       my $s = $old_scope->{$t};
       $scope->{$t} = {} unless ref $scope->{$t}; my $sc = $scope->{$t};
-      for my $k (keys %$s)
+      for my $k (sort keys %$s)
         {
         # skip things like "_is_group"
         $sc->{$k} = $s->{$k} unless $k =~ /^_/;
       $scope->{$type} = {} unless ref $scope->{$type};
       my $s = $scope->{$type};
 
-      for my $k (keys %$att)
+      for my $k (sort keys %$att)
         {
         $s->{$k} = $att->{$k};
         }
   # add all graph attributes to group, too
   my $group = $vcg_remap->{group};
   my $graph = $vcg_remap->{graph};
-  for my $k (keys %$graph)
+  for my $k (sort keys %$graph)
     {
     $group->{$k} = $graph->{$k};
     }
 #    use Data::Dumper; print Dumper($att);
 
   # handle the "colorentry 00" entries:
-  for my $key (keys %$att)
+  for my $key (sort keys %$att)
     {
     if ($key =~ /^colorentry\s+([0-9]{1,2})/)
       {

Graph-Easy/lib/Graph/Easy/Util.pm

+package Graph::Easy::Util;
+
+use strict;
+use warnings;
+
+use base 'Exporter';
+
+our @EXPORT_OK = (qw(first_kv));
+
+use List::Util qw(minstr);
+
+=head1 FUNCTIONS
+
+=head2 first_kv($hash_ref)
+
+The first key value pair from a hash reference - lexicographically.
+
+=cut
+
+sub first_kv
+{
+    my $href = shift;
+
+    my $n = minstr( keys(%$href) );
+    my $v = $href->{$n};
+
+    return ($n, $v);
+}
+
+1;
+

Graph-Easy/t/ascii.t

   if (!
     is ($ascii, $out, "from $f"))
     {
+        if ($ENV{__SHLOMIF__UPDATE_ME})
+        {
+            require IO::All;
+            IO::All->new->file("out/$f")->print($ascii);
+        }
     push @failures, $f;
     if (defined $Test::Differences::VERSION)
       {
   if (!
     is ($graph->as_txt(), $txt, "$f as_txt"))
     {
+        if ($ENV{__SHLOMIF__UPDATE_ME})
+        {
+            require IO::All;
+            IO::All->new->file("txt/$f")->print($graph->as_txt());
+        }
     push @failures, $f;
     if (defined $Test::Differences::VERSION)
       {

Graph-Easy/t/out/10_repair.txt

              '                              +----------+ '
              '                                           '
              +- - - - - - - - - - - - - - - - - - - - - -+
++ - - - - - - - - - - - - - - - - - +
+' DMZ:                              '
+'                                   '
+' +---------+         +-----------+ '       +----------+
+' | Server  | <------ |   Proxy   | ' -->   |  Check   |
+' +---------+         +-----------+ '       +----------+
+'                       |           '
++ - - - - - - - - -     |           '
+                    '   |           '         |
+                    '   |           '         |
+                    '   |           '         v
+                    '   |             - - - - - - - - - -+
+                    '   v                                '
+                    ' +-----------+         +----------+ '
+                    ' | Database  | ------> | Backend  | '
+                    ' +-----------+         +----------+ '
+                    '                                    '
                     + - - - - - - - - - - - - - - - - - -+
-                    ' DMZ:                               '
-                    '                                    '
-  +---------+       ' +-----------+         +----------+ '
-  |  Check  |   <-- ' |   Proxy   | ------> |  Server  | '
-  +---------+       ' +-----------+         +----------+ '
-    |               '   |                                '
-    |               '   |                                '
-    |               '   v                                '
-    |               ' +-----------+         +----------+ '
-    |               ' | Database  | ------> | Backend  | '
-    |               ' +-----------+         +----------+ '
-    |               '                                    '
-    |               + - - - - - - - - - - - - - - - - - -+
-    |                                         ^
-    +-----------------------------------------+

Graph-Easy/t/out/3_joining.txt

   +---------+----+
   |         v    |
 +---+     +---+  |
-| A |     | C |  |
+| A |     | B |  |
 +---+     +---+  |
   |         ^    |
   |         |    |
             |    |
             v    |
           +---+  |
-          | B | <+
+          | C | <+
           +---+

Graph-Easy/t/out/3_nodes_5_edges.txt

 
-       +- - - - - - - - - - - - - - - - - - +
-       '                                    v
+       #= = = = = = = = = = = = = = = = = = #
+       "                                    v
      +--------------+     +---------+     +-----------+
   +- | Default Page | --> | Sign Up | --> |           |
   !  +--------------+     +---------+     |           |
-  !    "                                  |           |
-  !    #= = = = = = = = = = = = = = = = > | Main Page |
+  !    '                                  |           |
+  !    +- - - - - - - - - - - - - - - - > | Main Page |
   !                                       |           |
   !                                       |           |
   +-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-> |           |

Graph-Easy/t/out/4_bug_basename.txt

-          +---+
-  +------ | u | -+
-  |       +---+  |
-  |         |    |
-  |         |    |
-  v         v    |
-+---+----+----+  |
-| a |  b |  c |  |
-+---+----+----+  |
-       ^         |
+
        +---------+
+       |         v
+     +---+----+----+----+
+  +- | u |  a |  b |  c |
+  |  +---+----+----+----+
+  |    |    ^         ^
+  |    +----+         |
+  |                   |
+  |                   |
+  +-------------------+

Graph-Easy/t/out/4_cross_split_hor.txt

-            + - - - - -+
-            ' Cross:   '
-            '          '
-            ' +------+ '
-            ' |  A   | '
-            ' +------+ '
-            '   |      '
-            '   |      '
-            '   |      '
-+ - - - - -     |       - - - - - -+
-'               |                  '
-' +---+         |            +---+ '
-' | C | --------+----------> | D | '
-' +---+         |            +---+ '
-'               |                  '
-+ - - - - -     |       - - - - - -+
-            '   |      '
-            '   |      '
-            '   v      '
-            ' +------+ '
-            ' |  B   | '
-            ' +------+ '
-            '          '
-            + - - - - -+
+               +- - - -+
+               '       '
+               ' +---+ '
+               ' | A | '
+               ' +---+ '
+               '   |   '
+               '   |   '
+               '   |   '
++ - - - - - - -    |    - - - - - -+
+' Cross:           |               '
+'                  |               '
+' +------+         |         +---+ '
+' |  C   | --------+-------> | D | '
+' +------+         |         +---+ '
+'                  |               '
++ - - - - - - -    |    - - - - - -+
+               '   |   '
+               '   |   '
+               '   v   '
+               ' +---+ '
+               ' | B | '
+               ' +---+ '
+               '       '
+               +- - - -+

Graph-Easy/t/out/4_edge_cross.txt

 
-             +---------------------+
-             |                     |
-             |                     |
-  +----------+----------+          |
-  |          |          v          v
-+----+     +----+     +----+     +----+
-| E1 | --> | E2 | --> | S1 | --> | S2 |
-+----+     +----+     +----+     +----+
-  |                                ^
-  +--------------------------------+
+  +---------------------+
+  |                     v
++----+     +----+     +----+
+| E1 | --> | S1 | --> | S2 |
++----+     +----+     +----+
+  |          ^          ^
+  |          |          |
+  v          |          |
++----+       |          |
+| E2 | ------+----------+
++----+       |
+  |          |
+  +----------+

Graph-Easy/t/out/4_joint_bug_flags.txt

        |   +---+
        +-> | C |
        |   +---+
+       |
+       |
+       |
        |   +---+
        +-> | D |
            +---+

Graph-Easy/t/out/4_lists.txt

-+--------+     +-----------+
-|  Bonn  | --> | Frankfurt |
-+--------+     +-----------+
-  |              ^
-  |              |
-  v              |
-+--------+     +-----------+
-| Berlin | <-- |    Ulm    |
-+--------+     +-----------+
+
+  +---------------------------------------+
+  |                                       v
++------+     +--------+     +-----+     +-----------+
+| Bonn | --> | Berlin | <-- | Ulm | --> | Frankfurt |
++------+     +--------+     +-----+     +-----------+

Graph-Easy/t/out/4_minlen.txt

 +---------+          +---------+          +---------+
-| Potsdam | <------- | Berlin  | -------> | Cottbus |
+| Potsdam | <------- | Berlin  | -------> | Leipzig |
 +---------+          +---------+          +---------+
                        |
                        |
                        |
                        v
                      +---------+
-                     | Leipzig |
+                     | Cottbus |
                      +---------+

Graph-Easy/t/out/5_arrow_styles.txt

-+----------+
-|  Hagnau  | -------+
-+----------+        |
-  |                 |
++----------+      +--------------+
+| Uhlingen | ---- |    Hagnau    |
++----------+      +--------------+
+  ^                 |
   |                 |
   |                 |                     +---------------------+
   |                 |                     |                     |
-+----------+      +--------------+      .................     +--------+
-| Uhlingen | <--> | Oberuhlingen | <--> : Unteruhlingen : --- | Mainau |
-+----------+      +--------------+      :...............:     +--------+
+  |               +--------------+      .................     +--------+
+  +-------------> | Oberuhlingen | <--> : Unteruhlingen : --- | Mainau |
+                  +--------------+      :...............:     +--------+

Graph-Easy/t/out/7_star.txt

-             +----------+
-             |  Weimar  |
-             +----------+
+             +-----------+
+             |  Weimar   |
+             +-----------+
                ^
                |
                |
-+------+     +----------+     +-----------+
-| Kiel | <-- |          | --> | Frankfurt |
-+------+     |  Dachau  |     +-----------+
-+------+     |          |     +-----------+
-| Ulm  | <-- |          | --> |  Berlin   |
-+------+     +----------+     +-----------+
++------+     +-----------+     +----------+
+| Kiel | <-- |           | --> | Chemnitz |
++------+     |  Dachau   |     +----------+
++------+     |           |     +----------+
+| Ulm  | <-- |           | --> |  Berlin  |
++------+     +-----------+     +----------+
                |
                |
                v
-             +----------+
-             | Chemnitz |
-             +----------+
+             +-----------+
+             | Frankfurt |
+             +-----------+

Graph-Easy/t/out/7_tree.txt

   |         +------> | A23 |
   |         |        +-----+
   |         |        +-----+
+  |         +------> | A21 |
+  |         |        +-----+
+  |         |        +-----+
   |         +------> | A22 |
-  |         |        +-----+
-  |         |        +-----+
-  |         +------> | A21 |
   |                  +-----+
   |       +----+
   +-----> | A3 |

Graph-Easy/t/out/8_invisible.txt

                     |       |          |       | .............> |      |
                     +-------+          +-------+                +------+
                                          H
-  + - - - - - - - - - +                  H
-  '                   '                  v
-  '                 +-------+          +-------+  Test label    +------+
-  '                 | Five  | <======> | Three | <............> | Six  |
-  '                 +-------+          +-------+                +------+
-  '
-  '
-  '
-  '                 +-------+          +-------+
-  '                 | Seven |          | Eight |
-  '                 +-------+          +-------+
-  '   Test label      ^
-  + - - - - - - - - - +
+                                         H
+                                         v
+                    +-------+          +-------+  Test label    +------+
+       +- - - - - - | Five  | <======> | Three | <............> | Six  |
+       '            +-------+          +-------+                +------+
+       '
+       ' Test label
+       '
+       '            +-------+          +-------+
+       +- - - - - > | Seven |          | Eight |
+                    +-------+          +-------+

Graph-Easy/t/out/8_labels.txt

 
-                            My sample graph
+                              My sample graph
 
-                    +-------+          +-------+  Test          +------+
-                    |  Two  |  label   |  One  |  label         | Four |
-                    |       | <------- |       | .............> |      |
-                    +-------+          +-------+                +------+
-                                         H
-  + - - - - - - - - - +                  H
-  '                   '                  v
-  '                 +-------+          +-------+  Test label    +------+
-  '    +----------- | Five  | <======> | Three | <............> | Six  |
-  '    |            +-------+          +-------+                +------+
-  '    |              |
-  '    |              +------------------+
-  '    |                                 v
-  '    |            +-------+          +-------+
-  '    +----------> | Seven | -------- | Eight |
-  '                 +-------+          +-------+
-  '   Test label      ^
-  + - - - - - - - - - +
+                            Test label
+                   +- - - - - - - - - - - - +
+                   '                        v
+                 +--------+               +-------+                +-------+
+         #=====> |  Five  | ------------> | Seven | -------------- | Eight |
+         H       +--------+               +-------+                +-------+
+         H         |                                                 ^
+         H         +-------------------------------------------------+
+         H
+         H
+         #==================================#
+                                            v
++-----+  label   +--------+               +-------+  Test label    +-------+
+| Two | <------- |  One   | ============> | Three | <............> |  Six  |
++-----+          +--------+               +-------+                +-------+
+                   :
+                   : Test
+                   : label
+                   v
+                 +--------+
+                 |  Four  |
+                 +--------+

Graph-Easy/t/out/8_optimize_bend.txt

-               +------------+
-               |   printf   |
-               +------------+
-                 ^
-                 ' 100 times
-                 '
-+--------+     +------------+     +-------+     +---------+     +---------+
-|  init  | <.. |    main    | --> | parse | --> | execute | --> | compare |
-+--------+     +------------+     +-------+     +---------+     +---------+
-  |              |                                |
-  |              | Testlabel                      |
-  v              v                                |
-+--------+     +------------+                     |
-| make a |     |  cleanup   |                     |
-| string |     |            |                     |
-+--------+     +------------+                     |
-  ^                                               |
-  +-----------------------------------------------+
+
+  ..............
+  :            :
+  :            :
+  :       +----+------------------------------------------------+
+  v       |    :                                                v
++------+  |  +------------+     +-------+     +---------+     +--------+
+| init |  |  |    main    |     | parse |     | execute |     | make a |
+|      | -+  |            | --> |       | --> |         | --> | string |
++------+     +------------+     +-------+     +---------+     +--------+
+               |                                |
+               | Testlabel                      |
+               v                                v
+             +------------+                   +---------+
+             |  cleanup   |                   | compare |
+             +------------+                   +---------+
+             +------------+
+             |   printf   |
+             +------------+

Graph-Easy/t/out/9_flow_south.txt

   |     |     |     |     |     |     |     |
   v     v     v     v     v     v     v     v
 +----++----++----++----++----++----++----++----+
-| A1 || A2 || A3 || A4 || A5 || A6 || A7 || A8 |
+| A3 || A1 || A2 || A4 || A5 || A6 || A7 || A8 |
 +----++----++----++----++----++----++----++----+