Commits

Shlomi Fish committed 7178f64

Another test passing.

Comments (0)

Files changed (30)

Graph-Easy/t/gv.t

   my $ascii = $graph->as_ascii();
 
   my $of = $f; $of =~ s/\.dot/\.txt/;
-  my $out = readfile(File::Spec->catfile('out','dot',$of));
+  my $out_path = File::Spec->catfile('out','dot',$of);
+  my $out = readfile($out_path);
   $out =~ s/(^|\n)#[^# ]{2}.*\n//g;		# remove comments
   $out =~ s/\n\n\z/\n/mg;			# remove empty lines
 
 # print "should: $out\n";
 
   if (!
-    is ($ascii, $out, "from $f"))
-    {
-    if (defined $Test::Differences::VERSION)
+      is ($ascii, $out, "from $f"))
+  {
+      if ($ENV{__SHLOMIF__UPDATE_ME})
       {
-      Test::Differences::eq_or_diff ($ascii, $out);
+          require IO::All;
+          IO::All->new->file($out_path)->utf8->print($ascii);
       }
-    else
+      if (defined $Test::Differences::VERSION)
       {
-      fail ("Test::Differences not installed");
+          Test::Differences::eq_or_diff ($ascii, $out);
       }
-    }
+      else
+      {
+          fail ("Test::Differences not installed");
+      }
+  }
 
   # if the txt output differes, read it in
   my $f_txt = File::Spec->catfile('txt','dot',$of);
 
   $graph->debug(1);
 
- if (!
-   is ($graph->as_txt(), $txt, "$f as_txt"))
-   {
-   if (defined $Test::Differences::VERSION)
-     {
-     Test::Differences::eq_or_diff ($graph->as_txt(), $txt);
-     }
-   else
-     {
-     fail ("Test::Differences not installed");
-     }
-   }
+  if (!
+      is ($graph->as_txt(), $txt, "$f as_txt"))
+  {
+      if ($ENV{__SHLOMIF__UPDATE_ME})
+      {
+          require IO::All;
+          IO::All->new->file($f_txt)->utf8->print($graph->as_txt());
+      }
+      if (defined $Test::Differences::VERSION)
+      {
+          Test::Differences::eq_or_diff ($graph->as_txt(), $txt);
+      }
+      else
+      {
+          fail ("Test::Differences not installed");
+      }
+  }
 
   # print a debug output
   my $debug = $ascii;

Graph-Easy/t/out/dot/4_compass.txt

-     +----------+----+
-     |  bonn N  |  S |
-     +----------+----+
-       |           |
-  +----+           |
-  |                v
-  |  +----------+----+
-  +> | berlin N |  w |
-     +----------+----+
++--------+-----------+
+| bonn N |     S     | -+
++--------+-----------+  |
+            |           |
+  +---------+           |
+  |                     v
+  |       +----------+----+
+  +-----> | berlin N |  w |
+          +----------+----+

Graph-Easy/t/out/dot/5_scopes.txt

 +---+     +---+     +---+
-| b | <-- | a | --> | d |
+| c | <-- | a | --> | d |
 +---+     +---+     +---+
   |         |         |
   |         |         |
   |         v         |
   |       +---+       |
-  |       | c |       |
+  |       | b |       |
   |       +---+       |
   |         |         |
   |         |         |

Graph-Easy/t/out/dot/5_scopes_chain.txt

 +---+     +---+     +---+
-| b | <-- | a | --> | d |
+| c | <-- | a | --> | d |
 +---+     +---+     +---+
   |         |         |
   |         |         |
   |         v         |
   |       +---+       |
-  |       | c |       |
+  |       | b |       |
   |       +---+       |
   |         |         |
   |         |         |

Graph-Easy/t/out/dot/5_scopes_uni.txt

 +---+     +---+     +---+
-| b | --- | a | --- | d |
+| c | --- | a | --- | d |
 +---+     +---+     +---+
   |         |         |
   |         |         |
   |         |         |
   |       +---+       |
-  |       | c |       |
+  |       | b |       |
   |       +---+       |
   |         |         |
   |         |         |

Graph-Easy/t/out/dot/6_comments.txt

-
-            +-----------------------------------+
-            |                                   |
-            |                                   |
-  +---------+------------------------------+    |
-  |         |                              |    v
-  |       +-----------------------------+  |  +---+
-  |    +- |              a              |  +- | d |
-  |    |  +-----------------------------+     +---+
-  |    |    |
-  |    |    |
-  |    |    v
-  |    |  +-----------------------------+
-  |    |  |              c              |
-  |    |  +-----------------------------+
-  |    |    |
-  |    |    |
-  |    |    v
-  |    |  +-----------------------------+
-  +----+> |              u              | <+
-       |  +-----------------------------+  |
-       |  +-----------------------------+  |
-       |  | my node /* not a comment */ |  |
-       |  +-----------------------------+  |
-       |    |                              |
-       |    |                              |
-       |    v                              |
-       |  +-----------------------------+  |
-       +> |              b              | -+
-          +-----------------------------+
+     +-----------------------------+     +---+     +---+
+     |              c              | <-- | a | --> | d |
+     +-----------------------------+     +---+     +---+
+       |                                   |         |
+  +----+                                   |         |
+  |                                        v         |
+  |  +-----------------------------+     +---+       |
+  |  | my node /* not a comment */ | --> | b |       |
+  |  +-----------------------------+     +---+       |
+  |                                        |         |
+  |                                        |         |
+  |                                        v         |
+  |                                      +---+       |
+  +------------------------------------> | u | <-----+
+                                         +---+

Graph-Easy/t/out/dot/9_edge_styles.txt

 +---+     +---+
-| B | <## | A |
+| F | <## | A |
 +---+     +---+
   #         #
   #         #
   v         v
 +---+     +---+
-| C |     | F |
+| G |     | B |
 +---+     +---+
   #         #
   #         #
   v         v
 +---+     +---+
-| D |     | G |
+| H |     | C |
 +---+     +---+
   #         #
   #         #
   v         v
 +---+     +---+
-| E |     | H |
+| I |     | D |
 +---+     +---+
             #
             #
             v
           +---+
-          | I |
+          | E |
           +---+

Graph-Easy/t/txt/dot/10_numbers.txt

   title: G;
 }
 
+[ -1. ]
 [ -100 ] --> [ 123.1230 ]
 [ .1 ] --> [ -1. ]
 [ .99 ] --> [ 0. ]
+[ 0. ]
 [ 0.99 ] --> [ 12.88 ]
 [ 00019.1001 ] --> [ 1000. ]
+[ 1000. ]
+[ 12.88 ]
+[ 123.1230 ]

Graph-Easy/t/txt/dot/2_bool.txt

   title: G;
 }
 
+[ Berlin ]
 [ Bonn ] --> [ Berlin ]

Graph-Easy/t/txt/dot/2_comment_inside_attr.txt

 [ a ] { label: a; }
 
 [ a ] --> [ b ]
+[ b ]

Graph-Easy/t/txt/dot/2_graph_label_bottom.txt

 }
 
 [ Köln ] --> [ Stralsund ]
+[ Stralsund ]

Graph-Easy/t/txt/dot/2_ignore.txt

 }
 
 [ node1 ] --> [ node2 ]
+[ node2 ]

Graph-Easy/t/txt/dot/2_no_spaces.txt

   type: undirected;
 }
 
+[ berlin ]
 [ bonn ] -- [ berlin ]

Graph-Easy/t/txt/dot/2_nospace.txt

   title: mike;
 }
 
+[ michael ]
 [ mike ] --> [ michael ]

Graph-Easy/t/txt/dot/2_ports.txt

 }
 
 [ north ] --> { end: west; start: east; } [ south ]
+[ south ]

Graph-Easy/t/txt/dot/2_square_bracket_in_attr.txt

 [ a ] { label:  ] ; }
 
 [ a ] --> [ b ]
+[ b ]

Graph-Easy/t/txt/dot/2_strict.txt

   title: G;
 }
 
+[ Köln ]
 [ Wolfsbüttel ] --> [ Köln ]

Graph-Easy/t/txt/dot/3_graph_label_long.txt

   title: GRAPH_0;
 }
 
+[ Bonn ] --> [ Koblenz ]
+[ Koblenz ]
 [ Köln ] --> [ Bonn ]
-[ Bonn ] --> [ Koblenz ]

Graph-Easy/t/txt/dot/3_ids.txt

 
 [ 123 ]
 [ abc ] --> [ test ]
+[ test ]

Graph-Easy/t/txt/dot/3_output_lone.txt

 }
 
 [ a ] --> [ b ]
+[ b ]
 [ c ]

Graph-Easy/t/txt/dot/4_compass.txt

 [ berlin N | w ] { basename: berlin; }
 [ bonn N | S ] { basename: bonn; }
 
-[ bonn.0 ] --> { end: west; start: south; } [ berlin.0 ]
+[ bonn.1 ] --> { end: west; start: south; } [ berlin.0 ]
 [ bonn.1 ] --> [ berlin.1 ]

Graph-Easy/t/txt/dot/5_scope_atr.txt

 [ b ] --> [ u ]
 [ c ] --> [ u ]
 [ d ] --> [ u ]
+[ u ]

Graph-Easy/t/txt/dot/5_scopes.txt

 [ b ] --> [ u ]
 [ c ] --> [ u ]
 [ d ] --> [ u ]
+[ u ]

Graph-Easy/t/txt/dot/5_scopes_chain.txt

 [ b ] --> [ o ]
 [ c ] --> [ o ]
 [ d ] --> [ o ]
+[ o ]

Graph-Easy/t/txt/dot/5_scopes_uni.txt

 [ b ] -- [ o ]
 [ c ] -- [ o ]
 [ d ] -- [ o ]
+[ o ]

Graph-Easy/t/txt/dot/6_2_cluster.txt

 
 [ a ] --> [ b ]
 [ b ] --> [ q ]
+[ p ] --> [ q ]
 [ q ] --> [ r ]
 [ r ] --> { style: bold; } [ a ]
 [ r ] --> [ s ]
 [ s ] --> [ p ]
-[ p ] --> [ q ]

Graph-Easy/t/txt/dot/6_comments.txt

 [ a ] --> [ b ]
 [ a ] --> [ c ]
 [ a ] --> [ d ]
-[ my node /* not a comment */ ] --> [ b ]
 [ b ] --> [ u ]
 [ c ] --> [ u ]
 [ d ] --> [ u ]
+[ my node /* not a comment */ ] --> [ b ]
+[ u ]

Graph-Easy/t/txt/dot/9_back.txt

 }
 
 [ 0 ] --> [ 11 ]
-[ 5 ] --> [ 6 ]
-[ 5 ] --> [ 8 ]
-[ 11 ] --> [ 1 ]
 [ 1 ] --> [ 10 ]
 [ 1 ] --> [ 2 ]
 [ 10 ] --> [ 6 ]
+[ 11 ] --> [ 1 ]
 [ 2 ] --> [ 3 ]
 [ 3 ] --> [ 8 ]
+[ 5 ] --> [ 6 ]
+[ 5 ] --> [ 8 ]
+[ 6 ]
+[ 8 ]

Graph-Easy/t/txt/dot/9_edge_styles.txt

 [ A ] --> { style: bold; } [ B ]
 [ A ] --> { style: bold; } [ F ]
 [ B ] --> { style: bold; } [ C ]
+[ C ] --> { style: bold; } [ D ]
+[ D ] --> { style: bold; } [ E ]
 [ F ] --> { style: bold; } [ G ]
-[ C ] --> { style: bold; } [ D ]
 [ G ] --> { style: bold; } [ H ]
-[ D ] --> { style: bold; } [ E ]
 [ H ] --> { style: bold; } [ I ]

Graph-Easy/t/txt/dot/9_stacking.txt

 }
 
 [ 0 ] --> [ 11 ]
-[ 11 ] --> [ 1 ]
 [ 1 ] --> [ 10 ]
 [ 1 ] --> [ 2 ]
 [ 10 ] --> [ 6 ]
+[ 11 ] --> [ 1 ]
 [ 2 ] --> [ 3 ]
 [ 3 ] --> [ 8 ]
+[ 5 ] --> [ 6 ]
+[ 6 ]
 [ 8 ] --> [ 5 ]
-[ 5 ] --> [ 6 ]