Mercurial > pub > Impl
comparison _test/object.t @ 3:2e546a5175dd
in developing
| author | Sergey |
|---|---|
| date | Tue, 11 Aug 2009 17:45:52 +0400 |
| parents | 78cd38551534 |
| children | 16ada169ca75 |
comparison
equal
deleted
inserted
replaced
| 2:78cd38551534 | 3:2e546a5175dd |
|---|---|
| 1 #!/usr/bin/perl -w | 1 #!/usr/bin/perl -w |
| 2 use strict; | 2 use strict; |
| 3 use lib '../Lib'; | 3 use lib '../Lib'; |
| 4 use lib '.'; | |
| 4 | 5 |
| 5 package Foo; | 6 use IMPL::Test::Plan; |
| 6 use base qw(IMPL::Object); | 7 use IMPL::Test::TAPListener; |
| 7 | 8 |
| 8 sub CTOR { | 9 my $plan = new IMPL::Test::Plan qw( |
| 9 my ($this,%args) = @_; | 10 Test::Object::Common |
| 10 print "CTOR Foo says $args{Name}\n"; | 11 Test::Object::List |
| 11 } | 12 ); |
| 12 | 13 |
| 13 sub Hello { | 14 $plan->AddListener(new IMPL::Test::TAPListener); |
| 14 print "\tHello\n"; | 15 $plan->Prepare(); |
| 15 } | 16 $plan->Run(); |
| 16 | |
| 17 package Bar; | |
| 18 use base qw(Foo); | |
| 19 | |
| 20 __PACKAGE__->PassThroughArgs; | |
| 21 | |
| 22 sub CTOR { | |
| 23 print "CTOR Bar\n"; | |
| 24 } | |
| 25 | |
| 26 package main; | |
| 27 | |
| 28 my $obj = new Bar ( Name => 'Tom') ; | |
| 29 | |
| 30 Hello $obj; |
