Acme-Machi

 view release on metacpan or  search on metacpan

t/Acme-Machi.t  view on Meta::CPAN

  $loli->have_the_habit_of('BFS');
  my $result_BFS = $loli->search_file_from((<*>)[0],'.',1);
  ok($result_DFS == $result_BFS, "Stable test");
  #############################################################


  # Produced Tree-like structures should be the same whichever 
  # method you chose to use.
  #############################################################
  open my $fh, '>', \ my $my_string;
  select $fh;
  my $data;

  $loli->have_the_habit_of('DFS');
  $loli->search_file_from((<*>)[0],'.',0);
  $result_DFS = $my_string;
  eval "$result_DFS";
  $result_DFS = $data;

  open $fh, '>', \ $my_string;
  select $fh;
  $loli->have_the_habit_of('BFS');
  $loli->search_file_from((<*>)[0],'.',0);
  $result_BFS = $my_string;
  eval "$result_BFS";
  $result_BFS = $data;
  select STDOUT;

  sub cmp  {
    my $hash_ref1 = $_[0];
    my $hash_ref2 = $_[1];
    foreach my $k (sort keys %$hash_ref1){
      if (ref $$hash_ref1{$k} eq ref {}){ 
        &cmp($$hash_ref1{$k}, $$hash_ref2{$k});
      } elsif (ref $$hash_ref1{$k} eq ref []){ #array
        if($#{$$hash_ref2{$k}} >0){
          (${$$hash_ref2{$k}}[$_] ne ${$$hash_ref2{$k}}[$_]) 



( run in 1.075 second using v1.01-cache-2.11-cpan-49f99fa48dc )