Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: serializer tests

by xmath (Hermit)
on Feb 17, 2003 at 18:04 UTC ( #236051=note: print w/replies, xml ) Need Help??


in reply to Re: Data::XDumper
in thread Data::XDumper

Thanks.. it has already helped me notice that when I recently "fixed" formatting of code refs, I actually broke them :-)

I've included the output of my latest version (not yet uploaded)..

******** Array Scalar Cross ******** [ $L002: \$L001, $L001: \$L002 ] ******** Array Contains Scalar Cross ******** [ \ $L002: \$L001, \ $L001: \$L002 ] ******** Leaf Loop ******** \ $L001: \$L001 ******** Big Mess ******** [ \ @L006: @( \%L001, \%L001, $L008: \$L002, \$L002, $L005: \$L003, \%L001, \$L004, \%L001, \%L001, $L007: \%L001 ), \ %L001: %( 0 => \$L005, $L003: 1 => \@L006, $L004: 2 => \$L007, 3 => \$L008, $L002: 4 => \$L007, 5 => \@L006, 6 => \$L007, 7 => \@L006, 8 => \@L006, 9 => \@L006 ) ] ******** Simple ******** [ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], { 1 => 2, 11 => 12, 13 => 14, 15 => 16, 17 => 18, 19 => 20, 3 => 4, 5 => 6, 7 => 8, 9 => 10 } ] ******** Simple Ref Test ******** {"abc\0'\efg" => "mno\0", reftest => \<ro> \<ro> 1} ******** Simple Ref Test 2 ******** [ \ @L003: @(1, \%L001, \@L002), \ %L001: %(aa => \@L003, bb => \%L001, cc => \@L002), \ @L002: @('c') ] ******** Simple AoH ******** [ \ $L002: [{a => \$L001}, {b => undef}], \ $L001: [{c => \$L001}, {d => \$L002}] ] ******** Parent Tree ******** \ @L001: @( \ @L002: @( \ @L004: @([0, \@L004], [1, \@L004], 2, \@L002), \ @L005: @([3, \@L005], [4, \@L005], 5, \@L002), 6, \@L001 ), \ @L003: @( \ @L006: @([7, \@L006], [8, \@L006], 9, \@L003), \ @L007: @([10, \@L007], [11, \@L007], 12, \@L003), 13, \@L001 ), 14, undef ) ******** Ref naming 01 ******** [ $L002: 'Foo', $L001: 'Bar', {bar => \$L001, foo => \$L002}, [\$L002, \$L001] ] ******** Ref naming 02 ******** [ $L001: 'Foo', $L002: 'Bar', [\$L001, \$L002], {bar => \$L002, foo => \$L001} ] ******** Ref naming 03 ******** [ $L001: 'Foo', [\$L001, \$L002], $L002: 'Bar', {bar => \$L002, foo => \$L001} ] ******** Ref naming 04 ******** [ [\$L001, \$L002], $L001: 'Foo', $L002: 'Bar', {bar => \$L002, foo => \$L001} ] ******** Ref naming 05 ******** [ $L002: 'Foo', {bar => \$L001, foo => \$L002}, $L001: 'Bar', [\$L002, \$L001] ] ******** Ref naming 06 ******** [ $L002: 'Foo', {bar => \$L001, foo => \$L002}, [\$L002, \$L001], $L001: 'Bar' ] ******** Ref naming 07 ******** [ $L001: 'Foo', [\$L001, \$L002], {bar => \$L002, foo => \$L001}, $L002: 'Bar' ] ******** Ref naming 08 ******** [ [\$L001, \$L002], $L001: 'Foo', {bar => \$L002, foo => \$L001}, $L002: 'Bar' ] ******** Ref naming 09 ******** [ {bar => \$L001, foo => \$L002}, $L002: 'Foo', $L001: 'Bar', [\$L002, \$L001] ] ******** Ref naming 10 ******** [ {bar => \$L001, foo => \$L002}, $L002: 'Foo', [\$L002, \$L001], $L001: 'Bar' ] ******** Ref naming 11 ******** [ {bar => \$L001, foo => \$L002}, [\$L002, \$L001], $L002: 'Foo', $L001: 'Bar' ] ******** Ref naming 12 ******** [ [\$L001, \$L002], {bar => \$L002, foo => \$L001}, $L001: 'Foo', $L002: 'Bar' ] ******** Ref naming 13 ******** [ $L001: 'Bar', $L002: 'Foo', {bar => \$L001, foo => \$L002}, [\$L002, \$L001] ] ******** Ref naming 14 ******** [ $L002: 'Bar', $L001: 'Foo', [\$L001, \$L002], {bar => \$L002, foo => \$L001} ] ******** Ref naming 15 ******** [ $L002: 'Bar', [\$L001, \$L002], $L001: 'Foo', {bar => \$L002, foo => \$L001} ] ******** Ref naming 16 ******** [ [\$L001, \$L002], $L002: 'Bar', $L001: 'Foo', {bar => \$L002, foo => \$L001} ] ******** Ref naming 17 ******** [ $L001: 'Bar', {bar => \$L001, foo => \$L002}, $L002: 'Foo', [\$L002, \$L001] ] ******** Ref naming 18 ******** [ $L001: 'Bar', {bar => \$L001, foo => \$L002}, [\$L002, \$L001], $L002: 'Foo' ] ******** Ref naming 19 ******** [ $L002: 'Bar', [\$L001, \$L002], {bar => \$L002, foo => \$L001}, $L001: 'Foo' ] ******** Ref naming 20 ******** [ [\$L001, \$L002], $L002: 'Bar', {bar => \$L002, foo => \$L001}, $L001: 'Foo' ] ******** Ref naming 21 ******** [ {bar => \$L001, foo => \$L002}, $L001: 'Bar', $L002: 'Foo', [\$L002, \$L001] ] ******** Ref naming 22 ******** [ {bar => \$L001, foo => \$L002}, $L001: 'Bar', [\$L002, \$L001], $L002: 'Foo' ] ******** Ref naming 23 ******** [ {bar => \$L001, foo => \$L002}, [\$L002, \$L001], $L001: 'Bar', $L002: 'Foo' ] ******** Ref naming 24 ******** [ [\$L001, \$L002], {bar => \$L002, foo => \$L001}, $L002: 'Bar', $L001: 'Foo' ] ******** Sub ******** [\&(code:125)] ******** Sub2 ******** [\&(code:126)] ******** HoS ******** [{sub1 => \&(code:125), sub2 => \&(code:126)}] ******** AoS ******** [[\&(code:125), \&(code:126)]] ******** H&AoS ******** [ [ \ &L001: &(code:125), \ &L002: &(code:126) ], {sub1 => \&L001, sub2 => \&L002} ] ******** Dog Kennel 1 ******** [ *dogs, \ %L001: %(First => \'Fido', Second => \'Wags'), \%L001 ] ******** Dog Kennel 2 ******** [ <anon> *dogs, \ %L001: %(First => \'Fido', Second => \'Wags'), \%L001 ] ******** Dog Kennel 3 ******** [ *dogs, \ %L001: %(First => \'Fido', Second => \'Wags'), \%L001 ] ******** Dog Kennel 4 ******** [ <anon> *dogs, \ %L001: %(First => \'Fido', Second => \'Wags'), \%L001 ] ******** Dog Kennel 5 ******** [ \ %L001: %(First => \'Fido', Second => \'Wags'), *dogs, \%L001 ] ******** Dog Kennel 6 ******** [ \ %L001: %(First => \'Fido', Second => \'Wags'), <anon> *dogs, \%L001 ] ******** Dog Kennel 7 ******** [ \ %L001: %(First => \'Fido', Second => \'Wags'), *dogs, \%L001 ] ******** Dog Kennel 8 ******** [ \ %L001: %(First => \'Fido', Second => \'Wags'), <anon> *dogs, \%L001 ] ******** Dog Kennel 9 ******** [ \ %L001: %(First => \'Fido', Second => \'Wags'), \%L001, *dogs ] ******** Dog Kennel 10 ******** [ \ %L001: %(First => \'Fido', Second => \'Wags'), \%L001, <anon> *dogs ] ******** Dog Kennel 11 ******** [ \ %L001: %(First => \'Fido', Second => \'Wags'), \%L001, *dogs ] ******** Dog Kennel 12 ******** [ \ %L001: %(First => \'Fido', Second => \'Wags'), \%L001, <anon> *dogs ]

I'll reupload as soon as I've fixed code refs.
•Update: I think I fixed them. I updated the above dump too

Replies are listed 'Best First'.
Re: Re: serializer tests
by demerphq (Chancellor) on Feb 17, 2003 at 18:36 UTC

    I'm very impressed. :-) I don't like the notation but I am very impressed indeed. A couple of niggles though. It looks like the results of the "Dog Kennel" tests are inconsistent. Id also like to see the results of

    { my ($x,$y,$z); my $to_dump=capture(capture($x,$y,$z),$x,$y,$z); }

    Ill be checking this module out very soon indeed. ++ to you.

    ---
    demerphq


      Before you complain about the notation, consider carefully whether it can be improved without losing accuracy :-)

      For example, I don't like the output of "Parent Tree", but it's a necessary evil. The output tends to look better on real-life data than on contrieved examples though.

      The "Dog Kennel" tests aren't inconsistent btw. Consider that [] copies the glob while capture() doesn't. That means the glob inside [] is an anonymous copy of *dogs, not the real thing.

      Here's the output of your snippet:

      [ [$L001, $L002, $L003], $L001: undef, $L002: undef, $L003: undef ]

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://236051]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2020-06-02 02:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (12 votes). Check out past polls.

    Notices?