Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Test::Deep::noclass propagation

by choroba (Cardinal)
on Sep 22, 2020 at 22:57 UTC ( [id://11122101]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $o = bless { x => bless ['y'], 'My::Value' }, 'My::Class';
    
  2. or download this
    { x => [$v], # where $v is 'y' or 'z'
      a => 'b' } # if a exists at all
    
  3. or download this
    cmp_deeply $o, noclass(subhashof({ a => 'b', x => subbagof('y', 'z') }
    +));
    
  4. or download this
    #   Failed test at ...
    # Comparing $data->{"x"} as a SubBag
    # got    : My::Value=ARRAY(0x561fbd1fe3a8)
    # expect : An array to use as a Bag
    
  5. or download this
    cmp_deeply { x => ['y'] },
               subhashof({ a => 'b', x => subbagof('y', 'z') });
    
  6. or download this
    use Test2::Tools::Compare qw{ like hash item field in_set DNE bag };
    
    ...
    like $o, hash { field a => in_set(DNE(), 'b');
                    field x => [ in_set('y', 'z') ];
             };
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11122101]
Approved by LanX
Front-paged by LanX
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-26 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found