Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Testing by Contract

by Ovid (Cardinal)
on Jun 30, 2003 at 18:28 UTC ( [id://270259]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub foo {
      my ($foo,$bar,@baz) = @_;
    
  2. or download this
    public void set_foo(int bar) { ... }
    
    public void set_foo(int bar, int length) { ... }
    
  3. or download this
    sub foo {
      my ($bar,$baz,$quux) = @_;
    ...
      # now test $quux
      # do our stuff
    }
    
  4. or download this
    +-----+      +-----+      +-----+      +-----+      +-----+
    |     |  AB  |     |  BC  |     |  CD  |     |  DE  |     |
    |  A  |----->|  B  |----->|  C  |----->|  D  |----->|  E  |
    |     |      |     |      |     |      |     |      |     |
    +-----+      +-----+      +-----+      +-----+      +-----+
    
  5. or download this
    sub assign_contract {
        my ($function_name, %contract) = @_;
    ...
        }
        return @results;
    }
    
  6. or download this
      use Test::More tests => 32;
      use Test::Contract 'contract_file';
    
  7. or download this
      package Foo::Bar;
      use Contract::File 'Foo::Bar::Contract'; # I don't quite like this
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-23 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found