r37385 - in /branches/upstream/libdata-peek-perl/current: ChangeLog META.yml Makefile.PL Peek.pm Peek.xs README t/10_DDumper.t t/20_DPeek.t t/21_DDisplay.t t/30_DDump-s.t t/31_DDump-s.t t/40_DDump-h.t t/41_DDump-h.t t/50_DDual.t t/51_triplevar.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Wed Jun 3 17:37:21 UTC 2009


Author: jawnsy-guest
Date: Wed Jun  3 17:37:16 2009
New Revision: 37385

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=37385
Log:
[svn-upgrade] Integrating new upstream version, libdata-peek-perl (0.27)

Modified:
    branches/upstream/libdata-peek-perl/current/ChangeLog
    branches/upstream/libdata-peek-perl/current/META.yml
    branches/upstream/libdata-peek-perl/current/Makefile.PL
    branches/upstream/libdata-peek-perl/current/Peek.pm
    branches/upstream/libdata-peek-perl/current/Peek.xs
    branches/upstream/libdata-peek-perl/current/README
    branches/upstream/libdata-peek-perl/current/t/10_DDumper.t
    branches/upstream/libdata-peek-perl/current/t/20_DPeek.t
    branches/upstream/libdata-peek-perl/current/t/21_DDisplay.t
    branches/upstream/libdata-peek-perl/current/t/30_DDump-s.t
    branches/upstream/libdata-peek-perl/current/t/31_DDump-s.t
    branches/upstream/libdata-peek-perl/current/t/40_DDump-h.t
    branches/upstream/libdata-peek-perl/current/t/41_DDump-h.t
    branches/upstream/libdata-peek-perl/current/t/50_DDual.t
    branches/upstream/libdata-peek-perl/current/t/51_triplevar.t

Modified: branches/upstream/libdata-peek-perl/current/ChangeLog
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/ChangeLog?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/ChangeLog (original)
+++ branches/upstream/libdata-peek-perl/current/ChangeLog Wed Jun  3 17:37:16 2009
@@ -1,62 +1,75 @@
+2009-06-03 0.27 - H.Merijn Brand   <h.m.brand at xs4all.nl>
+
+    * void context behaviour for DPeek ()
+    * void context behaviour for DDual ()
+
+2009-06-03 0.26 - H.Merijn Brand   <h.m.brand at xs4all.nl>
+
+    * Upped copyright to 2009
+    * Corrected paren placement for bless (...)
+    * Documentation fixes
+    * Added Test::NoWarnings
+    * Added DDsort ()
+
 2008-11-24 0.25 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
-	* Wrong e-mail in META.yml
-	* #34831 fixed tied $,
+    * Wrong e-mail in META.yml
+    * #34831 fixed tied $,
 
 2008-10-31 0.24 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
-	* Implement DDisplay ()
-	* Implement triplevar ()
-	* Update ppport.h to 3.14_05 (mhx++)
-	* 5.6.x DDisplay ()'s UTF8 different
-	* make leaktest/leakcheck enabled and executed
+    * Implement DDisplay ()
+    * Implement triplevar ()
+    * Update ppport.h to 3.14_05 (mhx++)
+    * 5.6.x DDisplay ()'s UTF8 different
+    * make leaktest/leakcheck enabled and executed
 
 2008-10-21 0.23 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
-	* Selecting to install DP did not install Data::Peek
+    * Selecting to install DP did not install Data::Peek
 
 2008-10-20 0.22 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
-	* Updated to ppport-3.14_01
-	* YAML declared 1.4 (META.yml) instead of 1.1 (YAML)
-	* DP.pm gets version from Peek.pm
-	* DP.pm should not be installed in Data namespace
+    * Updated to ppport-3.14_01
+    * YAML declared 1.4 (META.yml) instead of 1.1 (YAML)
+    * DP.pm gets version from Peek.pm
+    * DP.pm should not be installed in Data namespace
 
 2008-10-13 0.21 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
-	* Typo in pod (Joshua Juran)
-	* MSwin doesn't use plain \n (RT#39916)
-	* Some MSWin (ActivePerl) and AIX builds do not have
-	  Perl_sv_peek () exported (RT#39916)
+    * Typo in pod (Joshua Juran)
+    * MSwin doesn't use plain \n (RT#39916)
+    * Some MSWin (ActivePerl) and AIX builds do not have
+      Perl_sv_peek () exported (RT#39916)
 
 2008-10-08 0.20 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
-	* Renamed DDumper to Data::Peek
-	* Default argument for DPeek is $_
-	* Optionally install DP as shortcut for Data::Peek
-	* Public git repo set up
+    * Renamed DDumper to Data::Peek
+    * Default argument for DPeek is $_
+    * Optionally install DP as shortcut for Data::Peek
+    * Public git repo set up
 
 2008-10-07 0.16 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
-	* Allocated length for PV's depends on arch (upped test to 8)
-	* Released on Amsterdam.pm
+    * Allocated length for PV's depends on arch (upped test to 8)
+    * Released on Amsterdam.pm
 
 2008-09-26 0.15 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
-	* Start writing tests for DDump ()
-	* Added DDual ()
+    * Start writing tests for DDump ()
+    * Added DDual ()
 
 2008-09-25 0.11 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
-	* PerlIO is only available in 5.8 and up
-	* Perl 5.6 is a minimal requirement for 'use warnings'
-	* Tests for DPeek ()
-	* 5.8.0 did not export Perl_sv_catpvn ()
-	* Tested for 5.6.2, 5.8.0, 5.8.7, 5.8.8, 5.10.0, and devel
-	* Tests for DDumper ()
-	* Doc changes
-	* In void context DDumper prints to STDERR
+    * PerlIO is only available in 5.8 and up
+    * Perl 5.6 is a minimal requirement for 'use warnings'
+    * Tests for DPeek ()
+    * 5.8.0 did not export Perl_sv_catpvn ()
+    * Tested for 5.6.2, 5.8.0, 5.8.7, 5.8.8, 5.10.0, and devel
+    * Tests for DDumper ()
+    * Doc changes
+    * In void context DDumper prints to STDERR
 
 2008-09-24 0.10 - H.Merijn Brand   <h.m.brand at xs4all.nl>
 
-	* Initial attempt
+    * Initial attempt

Modified: branches/upstream/libdata-peek-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/META.yml?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/META.yml (original)
+++ branches/upstream/libdata-peek-perl/current/META.yml Wed Jun  3 17:37:16 2009
@@ -1,26 +1,32 @@
 --- #YAML:1.1
-name:              Data::Peek
-version:           0.25
-abstract:          Modified and extended debugging facilities
-license:           perl
+name:                    Data::Peek
+version:                 0.27
+abstract:                Modified and extended debugging facilities
+license:                 perl
 author:              
     - H.Merijn Brand <h.m.brand at xs4all.nl>
-generated_by:      Author
-distribution_type: module
+generated_by:            Author
+distribution_type:       module
 provides:
     Data::Peek:
-        file:      Peek.pm
-        version:   0.25
+        file:            Peek.pm
+        version:         0.27
 requires:     
-    perl:          5.006
-    DynaLoader:    0
+    perl:                5.006
+    DynaLoader:          0
+recommends:
+    perl:                5.008005
+configure_requires:
+    ExtUtils::MakeMaker: 0
 build_requires:
-    perl:          5.006
-    Data::Dumper:  0
-    Test::Harness: 0
-    Test::More:    0
+    perl:                5.006
+    Data::Dumper:        0
+    Test::Harness:       0
+    Test::More:          0
+    Test::NoWarnings:    0
 resources:
-    license:       http://dev.perl.org/licenses/
+    license:             http://dev.perl.org/licenses/
+    repository:          http://repo.or.cz/w/Data-Peek.git
 meta-spec:
-    version:       1.4
-    url:           http://module-build.sourceforge.net/META-spec-v1.4.html
+    version:             1.4
+    url:                 http://module-build.sourceforge.net/META-spec-v1.4.html

Modified: branches/upstream/libdata-peek-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/Makefile.PL?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/Makefile.PL (original)
+++ branches/upstream/libdata-peek-perl/current/Makefile.PL Wed Jun  3 17:37:16 2009
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# Copyright PROCURA B.V. (c) 2008-2008 H.Merijn Brand
+# Copyright PROCURA B.V. (c) 2008-2009 H.Merijn Brand
 
 require 5.006; # <- also see postamble at the bottom for META.yml
 use strict;
@@ -12,10 +12,11 @@
     ABSTRACT     => "Extended/Modified debugging utilities",
     AUTHOR       => "H.Merijn Brand <h.merijn\@xs4all.nl>",
     VERSION_FROM => "Peek.pm",
-    PREREQ_PM	 => { "DynaLoader"	=> 0,
-		      "Data::Dumper"	=> 0,
-		      "Test::More"	=> 0,
-		      "Test::Harness"	=> 0,
+    PREREQ_PM	 => { "DynaLoader"	 => 0,
+		      "Data::Dumper"	 => 0,
+		      "Test::More"	 => 0,
+		      "Test::Harness"	 => 0,
+		      "Test::NoWarnings" => 0,
 		      },
     clean        => { FILES => join " ", qw(
 			 Peek.c.gcov
@@ -130,7 +131,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2008-2008 H.Merijn Brand
+Copyright (C) 2008-2009 H.Merijn Brand
 
 This library is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.

Modified: branches/upstream/libdata-peek-perl/current/Peek.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/Peek.pm?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/Peek.pm (original)
+++ branches/upstream/libdata-peek-perl/current/Peek.pm Wed Jun  3 17:37:16 2009
@@ -6,9 +6,9 @@
 use DynaLoader ();
 
 use vars qw( $VERSION @ISA @EXPORT @EXPORT_OK );
-$VERSION   = "0.25";
+$VERSION   = "0.27";
 @ISA       = qw( DynaLoader Exporter );
- at EXPORT    = qw( DDumper DPeek DDisplay DDump DDual );
+ at EXPORT    = qw( DDumper DDsort DPeek DDisplay DDump DDual );
 @EXPORT_OK = qw( triplevar );
 $] >= 5.007003 and push @EXPORT, "DDump_IO";
 
@@ -18,13 +18,62 @@
 
 use Data::Dumper;
 
+my %sk = (
+    undef	=> 0,
+    ""		=> 0,
+    0		=> 0,
+    1		=> 1,
+
+    V	=> sub {	# Sort by value
+	    my $r = shift;
+	    [         sort { $r->{$a} cmp $r->{$b} } keys %$r ];
+	    },
+    VN	=> sub {	# Sort by value numeric
+	    my $r = shift;
+	    [         sort { $r->{$a} <=> $r->{$b} } keys %$r ];
+	    },
+    VNR	=> sub {	# Sort by value numeric reverse
+	    my $r = shift;
+	    [         sort { $r->{$b} <=> $r->{$a} } keys %$r ];
+	    },
+    VR	=> sub {	# Sort by value reverse
+	    my $r = shift;
+	    [         sort { $r->{$b} cmp $r->{$a} } keys %$r ];
+	    },
+    R	=> sub {	# Sort reverse
+	    my $r = shift;
+	    [ reverse sort                           keys %$r ];
+	    },
+    );
+my $_sortkeys = 1;
+
+sub DDsort
+{
+    @_ or return;
+
+    $_sortkeys = exists $sk{$_[0]} ? $sk{$_[0]} : $_[0];
+    } # DDsort
+
+sub import
+{
+    my @exp = @_;
+    my @etl;
+    foreach my $p (@exp) {
+	exists $sk{$p} and DDsort ($p), next;
+
+	push @etl, $p;
+	}
+    __PACKAGE__->export_to_level (1, @etl);
+    } # import
+
 sub DDumper
 {
-    local $Data::Dumper::Sortkeys = 1;
+    local $Data::Dumper::Sortkeys = $_sortkeys;
     local $Data::Dumper::Indent   = 1;
 
     my $s = Data::Dumper::Dumper @_;
     $s =~ s!^(\s*)'([^']*)'\s*=>!sprintf "%s%-16s =>", $1, $2!gme;	# Align => '
+    $s =~ s!\bbless\s*\(\s*!bless (!gm and $s =~ s!\s+\)([;,])$!)$1!gm;
     $s =~ s!^(?= *[]}](?:[;,]|$))!  !gm;
     $s =~ s!^(\s+)!$1$1!gm;
 
@@ -186,6 +235,35 @@
       foo              => 'egg'
       };
 
+=head2 DDsort ( 0 | 1 | R | V | VR | VN | VNR )
+
+Set the hash sort algorithm for DDumper. The default is to sort by key value.
+
+  0   - Do not sort
+  1   - Sort by key
+  R   - Reverse sort by key
+  V   - Sort by value
+  VR  - Reverse sort by value
+  VN  - Sort by value numerical
+  VNR - Reverse sort by value numerical
+
+These can also be passed to import:
+
+  $ perl -MDP=VNR -we'DDumper { foo => 1, bar => 2, zap => 3, gum => 13 }'
+  $VAR1 = {
+      gum              => 13,
+      zap              => 3,
+      bar              => 2,
+      foo              => 1
+      };
+  $ perl -MDP=V   -we'DDumper { foo => 1, bar => 2, zap => 3, gum => 13 }'
+  $VAR1 = {
+      foo              => 1,
+      gum              => 13,
+      bar              => 2,
+      zap              => 3
+      };
+
 =head2 DPeek
 
 =head2 DPeek ($var)
@@ -198,6 +276,8 @@
   print DPeek "abc\x{0a}de\x{20ac}fg";
 
   PV("abc\nde\342\202\254fg"\0) [UTF8 "abc\nde\x{20ac}fg"]
+
+In void context, C<DPeek ()> prints to C<STDERR> plus a newline.
 
 =head2 DDisplay
 
@@ -215,12 +295,12 @@
 
   "abc\nde\x{20ac}fg"
 
-=head2 DDual ($var [, $getmagic])
+=head2 my ($pv, $iv, $nv, $rv, $hm) = DDual ($var [, $getmagic])
 
 DDual will return the basic elements in a variable, guaranteeing that no
 conversion takes place. This is very useful for dual-var variables, or
 when checking is a variable has defined entries for a certain type of
-scalar. For each Integer (IV), Double (NV), String (PV), and Reference (RV),
+scalar. For each String (PV), Integer (IV), Double (NV), and Reference (RV),
 the current value of C<$var> is returned or undef if it is not set (yet).
 The 5th element is an indicator if C<$var> has magic, which is B<not> invoked
 in the returned values, unless explicitly asked for with a true optional
@@ -230,6 +310,17 @@
 
   print DPeek for DDual ($!, 1);
 
+In void context, DDual does the equivalent of
+
+  { my @d = DDual ($!, 1);
+    print STDERR
+      DPeek ($!), "\n",
+      "  PV: ", DPeek ($d[0]), "\n",
+      "  IV: ", DPeek ($d[1]), "\n",
+      "  NV: ", DPeek ($d[2]), "\n",
+      "  RV: ", DPeek ($d[3]), "\n";
+    }
+  
 =head2 triplevar ($pv, $iv, $nv)
 
 When making C<DDual ()> I wondered if it were possible to create triple-val
@@ -243,7 +334,7 @@
 Example:
 
   print DPeek for DDual
-      Data::Peek::triplevar ("\N{GREEK SMALL LETTER PI}", 3, 3.1415)'
+      Data::Peek::triplevar ("\N{GREEK SMALL LETTER PI}", 3, 3.1415);
 
   PV("\317\200"\0) [UTF8 "\x{3c0}"]
   IV(3)
@@ -251,7 +342,7 @@
   SV_UNDEF
   IV(0)
 
-=head3 DDump ($var [, $dig_level])
+=head2 DDump ($var [, $dig_level])
 
 A very useful module when debugging is C<Devel::Peek>, but is has one big
 disadvantage: it only prints to STDERR, which is not very handy when your
@@ -440,15 +531,18 @@
 
 =head1 BUGS
 
+Windows and AIX might be using a build where not all symbols that were
+supposed to be exported in the public API are not. Perl_pv_peek () is
+one of them.
+
 Not all types of references are supported.
 
-It might crash.
-
-No idea how far back this goes in perl support.
+No idea how far back this goes in perl support, but Devel::PPPort has
+proven to be a big help.
 
 =head1 SEE ALSO
 
-L<Devel::Peek(3)>, L<Data::Dumper(3)>, L<Data::Dump(3)>,
+L<Devel::Peek(3)>, L<Data::Dumper(3)>, L<Data::Dump(3)>, L<Devel::Dumpvar>,
 L<Data::Dump::Streamer(3)>
 
 =head1 AUTHOR
@@ -457,7 +551,7 @@
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright (C) 2008-2008 H.Merijn Brand
+Copyright (C) 2008-2009 H.Merijn Brand
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself.

Modified: branches/upstream/libdata-peek-perl/current/Peek.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/Peek.xs?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/Peek.xs (original)
+++ branches/upstream/libdata-peek-perl/current/Peek.xs Wed Jun  3 17:37:16 2009
@@ -1,4 +1,4 @@
-/*  Copyright (c) 2008-2008 H.Merijn Brand.  All rights reserved.
+/*  Copyright (c) 2008-2009 H.Merijn Brand.  All rights reserved.
  *  This program is free software; you can redistribute it and/or
  *  modify it under the same terms as Perl itself.
  */
@@ -17,12 +17,11 @@
 }
 #endif
 
-SV *_DDump (SV *sv)
+SV *_DDump (pTHX_ SV *sv)
 {
     int   err[3], n;
     char  buf[128];
     SV   *dd;
-    dTHX;
 
     if (pipe (err)) return (NULL);
 
@@ -30,46 +29,51 @@
     err[2] = dup (2);
     close (2);
     if (dup (err[1]) == 2)
-	Perl_sv_dump (aTHX_ sv);
+	sv_dump (sv);
     close (err[1]);
     close (2);
     err[1] = dup (err[2]);
     close (err[2]);
 
-    Perl_sv_setpvn (aTHX_ dd, "", 0);
+    sv_setpvn (dd, "", 0);
     while ((n = read (err[0], buf, 128)) > 0)
 #if PERL_VERSION >= 8
 	/* perl 5.8.0 did not export Perl_sv_catpvn */
-	Perl_sv_catpvn_flags (aTHX_ dd, buf, n, SV_GMAGIC);
+	sv_catpvn_flags (dd, buf, n, SV_GMAGIC);
 #else
-	Perl_sv_catpvn       (aTHX_ dd, buf, n);
+	sv_catpvn       (dd, buf, n);
 #endif
     return (dd);
     } /* _DDump */
 
+SV *_DPeek (pTHX_ int items, SV *sv)
+{
+#ifdef NO_SV_PEEK
+    return newSVpv ("Your perl did not export Perl_sv_peek ()", 0);
+#else
+    return newSVpv (sv_peek (items ? sv : DEFSV), 0);
+#endif
+    } /* _DPeek */
+
+void _Dump_Dual (pTHX_ SV *sv, SV *pv, SV *iv, SV *nv, SV *rv)
+{
+#ifndef NO_SV_PEEK
+    (void)fprintf (stderr, "%s\n  PV: %s\n  IV: %s\n  NV: %s\n  RV: %s\n",
+	sv_peek (sv), sv_peek (pv), sv_peek (iv), sv_peek (nv), sv_peek (rv));
+#endif
+    } /* _Dump_Dual */
+
 MODULE = Data::Peek		PACKAGE = Data::Peek
-
-#ifdef NO_SV_PEEK
 
 void
 DPeek (...)
   PROTOTYPE: ;$
   PPCODE:
-    ST (0) = newSVpv ("Your perl did not export Perl_sv_peek ()", 0);
+    I32 gimme = GIMME_V;
+    ST (0) = _DPeek (aTHX_ items, ST (0));
+    if (gimme == G_VOID) (void)fprintf (stderr, "%s\n", SvPVX (ST (0)));
     XSRETURN (1);
     /* XS DPeek */
-
-#else
-
-void
-DPeek (...)
-  PROTOTYPE: ;$
-  PPCODE:
-    ST (0) = newSVpv (Perl_sv_peek (aTHX_ items ? ST (0) : DEFSV), 0);
-    XSRETURN (1);
-    /* XS DPeek */
-
-#endif
 
 void
 DDisplay (...)
@@ -78,7 +82,7 @@
     SV *sv  = items ? ST (0) : DEFSV;
     SV *dsp = newSVpv ("", 0);
     if (SvPOK (sv) || SvPOKp (sv))
-	Perl_pv_pretty (aTHX_ dsp, SvPVX (sv), SvCUR (sv), 0,
+	pv_pretty (dsp, SvPVX (sv), SvCUR (sv), 0,
 	    NULL, NULL,
 	    (PERL_PV_PRETTY_DUMP | PERL_PV_ESCAPE_UNI_DETECT));
     ST (0) = dsp;
@@ -123,6 +127,8 @@
 
   PROTOTYPE: $;$
   PPCODE:
+    I32 gimme = GIMME_V;
+
     if (items > 1 && SvGMAGICAL (sv) && SvTRUE (ST (1)))
 	mg_get (sv);
 
@@ -152,6 +158,8 @@
 	PUSHs (&PL_sv_undef);
 
     mPUSHi (SvMAGICAL (sv) >> 21);
+
+    if (gimme == G_VOID) _Dump_Dual (aTHX_ sv, ST (0), ST (1), ST (2), ST (3));
     /* XS DDual */
 
 void
@@ -160,7 +168,7 @@
 
   PROTOTYPE: $
   PPCODE:
-    SV   *dd = _DDump (sv);
+    SV   *dd = _DDump (aTHX_ sv);
 
     if (dd) {
 	ST (0) = dd;
@@ -179,7 +187,7 @@
     IV      level
 
   PPCODE:
-    Perl_do_sv_dump (aTHX_ 0, io, sv, 1, level, 1, 0);
+    do_sv_dump (0, io, sv, 1, level, 1, 0);
     XSRETURN (1);
     /* XS DDump */
 

Modified: branches/upstream/libdata-peek-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/README?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/README (original)
+++ branches/upstream/libdata-peek-perl/current/README Wed Jun  3 17:37:16 2009
@@ -23,7 +23,7 @@
     http://repo.or.cz/w/Data-Peek.git
 
 Copying:
-    Copyright (c) 2008-2008 H.Merijn Brand.  All rights reserved.
+    Copyright (c) 2008-2009 H.Merijn Brand.  All rights reserved.
 
     This program is free software; you can redistribute it and/or modify
     it under the same terms as Perl itself.

Modified: branches/upstream/libdata-peek-perl/current/t/10_DDumper.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/t/10_DDumper.t?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/t/10_DDumper.t (original)
+++ branches/upstream/libdata-peek-perl/current/t/10_DDumper.t Wed Jun  3 17:37:16 2009
@@ -3,7 +3,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 42;
+use Test::More tests => 56;
+use Test::NoWarnings;
 
 BEGIN {
     use_ok "Data::Peek";
@@ -20,6 +21,8 @@
 	next;
 	}
 
+    $v =~ s/^S:([^:]*):// and DDsort ($1), $v =~ m/^()/; # And reset $1 for below
+
     unless ($v eq "") {
 	eval "\$var = $v";
 	ok ($dump = DDumper ($var),	"DDumper ($v)");
@@ -27,7 +30,7 @@
 	$dump =~ s/;\n\Z//;
 	}
     if ($re) {
-	like ($dump, qr{$exp}m,		".. content $re");
+	like ($dump, qr{$exp}ms,	".. content $re");
 	$1 and print STDERR "# '$1' (", length ($1), ")\n";
 	}
     else {
@@ -63,3 +66,10 @@
 				^ {4}\{\n {8}foo {14}=> 1\n {8}}\n	inner hash
 				^ {4}]\Z				outer list end
 [[0],{foo=>1}]			\A\[\n {4}\[\n {8}0\n {8}],\n {4}\{\n {8}foo {14}=> 1\n {8}}\n {4}]\Z	full struct
+--	Sorting
+S:1:{ab=>1,bc=>2,cd=>3,de=>13}	ab.*bc.*cd.*de	default sort
+S:R:{ab=>1,bc=>2,cd=>3,de=>13}	de.*cd.*bc.*ab	reverse sort
+S:V:{ab=>1,bc=>2,cd=>3,de=>13}	1.*13.*2.*3	sort by value
+S:VR:{ab=>1,bc=>2,cd=>3,de=>13}	3.*2.*13.*1	reverse sort by value
+S:VN:{ab=>1,bc=>2,cd=>3,de=>13}	1.*2.*3.*13	sort by value numeric
+S:VNR:{ab=>1,bc=>2,cd=>3,d=>13}	13.*3.*2.*1	reverse sort by value numeric

Modified: branches/upstream/libdata-peek-perl/current/t/20_DPeek.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/t/20_DPeek.t?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/t/20_DPeek.t (original)
+++ branches/upstream/libdata-peek-perl/current/t/20_DPeek.t Wed Jun  3 17:37:16 2009
@@ -4,6 +4,7 @@
 use warnings;
 
 use Test::More;
+use Test::NoWarnings;
 
 use Data::Peek;
 
@@ -14,7 +15,7 @@
     plan skip_all => $peek;
     }
 else {
-    plan tests => 49;
+    plan tests => 50;
     }
 
 like (DPeek ($/), qr'^PVMG\("\\(n|12)"\\0\)',	'$/');

Modified: branches/upstream/libdata-peek-perl/current/t/21_DDisplay.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/t/21_DDisplay.t?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/t/21_DDisplay.t (original)
+++ branches/upstream/libdata-peek-perl/current/t/21_DDisplay.t Wed Jun  3 17:37:16 2009
@@ -3,7 +3,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 9;
+use Test::More tests => 10;
+use Test::NoWarnings;
 
 use Data::Peek;
 

Modified: branches/upstream/libdata-peek-perl/current/t/30_DDump-s.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/t/30_DDump-s.t?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/t/30_DDump-s.t (original)
+++ branches/upstream/libdata-peek-perl/current/t/30_DDump-s.t Wed Jun  3 17:37:16 2009
@@ -4,7 +4,8 @@
 use warnings;
 
 # I would like more tests, but contents change over every perl version
-use Test::More tests => 5;
+use Test::More tests => 6;
+use Test::NoWarnings;
 
 use Data::Peek;
 

Modified: branches/upstream/libdata-peek-perl/current/t/31_DDump-s.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/t/31_DDump-s.t?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/t/31_DDump-s.t (original)
+++ branches/upstream/libdata-peek-perl/current/t/31_DDump-s.t Wed Jun  3 17:37:16 2009
@@ -3,7 +3,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More tests => 2;
+use Test::NoWarnings;
 
 use Data::Peek;
 

Modified: branches/upstream/libdata-peek-perl/current/t/40_DDump-h.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/t/40_DDump-h.t?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/t/40_DDump-h.t (original)
+++ branches/upstream/libdata-peek-perl/current/t/40_DDump-h.t Wed Jun  3 17:37:16 2009
@@ -3,7 +3,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More tests => 2;
+use Test::NoWarnings;
 
 use Data::Peek;
 

Modified: branches/upstream/libdata-peek-perl/current/t/41_DDump-h.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/t/41_DDump-h.t?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/t/41_DDump-h.t (original)
+++ branches/upstream/libdata-peek-perl/current/t/41_DDump-h.t Wed Jun  3 17:37:16 2009
@@ -3,7 +3,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 1;
+use Test::More tests => 2;
+use Test::NoWarnings;
 
 use Data::Peek;
 

Modified: branches/upstream/libdata-peek-perl/current/t/50_DDual.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/t/50_DDual.t?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/t/50_DDual.t (original)
+++ branches/upstream/libdata-peek-perl/current/t/50_DDual.t Wed Jun  3 17:37:16 2009
@@ -3,7 +3,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 69;
+use Test::More tests => 70;
+use Test::NoWarnings;
 
 use Data::Peek;
 

Modified: branches/upstream/libdata-peek-perl/current/t/51_triplevar.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdata-peek-perl/current/t/51_triplevar.t?rev=37385&op=diff
==============================================================================
--- branches/upstream/libdata-peek-perl/current/t/51_triplevar.t (original)
+++ branches/upstream/libdata-peek-perl/current/t/51_triplevar.t Wed Jun  3 17:37:16 2009
@@ -3,7 +3,8 @@
 use strict;
 use warnings;
 
-use Test::More tests => 32;
+use Test::More tests => 33;
+use Test::NoWarnings;
 
 use Data::Peek qw( DDual DPeek triplevar );
 




More information about the Pkg-perl-cvs-commits mailing list