Permalink
Browse files

pretty-print hoh, prepare v0.03

  • Loading branch information...
1 parent 93bbc20 commit f30224a5bdf9cf119ba63d0aaaa03287d10daa7f Steven Haryanto (on PC) committed Dec 25, 2010
Showing with 15 additions and 4 deletions.
  1. +5 −0 Changes
  2. +1 −1 dist.ini
  3. +1 −1 lib/Data/Format/Pretty/Console.pm
  4. +8 −2 t/01-basics.t
View
@@ -1,5 +1,10 @@
Revision history for Data-Format-Pretty-Console
+0.03 2010-12-24
+
+ Pretty print hash of hashes.
+
+
0.02 2010-11-20
In displaying list/hash, list elements/hash values are now "cells"
View
@@ -1,5 +1,5 @@
name = Data-Format-Pretty-Console
-version = 0.02
+version = 0.03
author = Steven Haryanto <stevenharyanto@gmail.com>
license = Perl_5
copyright_holder = Steven Haryanto
@@ -231,7 +231,7 @@ sub detect_struct {
while (my ($k, $v) = each %$data) {
my ($s2, $sm2) = detect_struct($v, {skip_hot=>1});
last CHECK_HOT unless $s2;
- $has_t = 1 if $s2 =~ /^(?:list|aoa|aoh)$/;
+ $has_t = 1 if $s2 =~ /^(?:list|aoa|aoh|hash)$/;
}
last CHECK_HOT unless $has_t;
$struct = "hot";
View
@@ -1,7 +1,7 @@
#!perl -Tw
use strict;
-use Test::More tests => 22;
+use Test::More tests => 24;
use Data::Dump::Partial qw(dumpp);
use Data::Format::Pretty::Console qw(format_pretty);
use YAML::Any;
@@ -72,7 +72,13 @@ my @data = (
},
{
- data => {a=>{}},
+ data => {a=>{k=>"v"}, b=>{k=>"v"}},
+ struct => "hot",
+ output_re => qr/^a:\n.+---.+/,
+ },
+
+ {
+ data => {a=>{b=>{}}},
struct => undef,
is_yaml => 1,
},

0 comments on commit f30224a

Please sign in to comment.