Guest User

Untitled

a guest
Jan 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #!/usr/bin/env perl
  2. use Test::More;
  3. use O qw/-qq Deparse/;
  4.  
  5. package Foo;
  6. sub Bar {}
  7.  
  8. package Foo::Bar;
  9. sub new { bless {}, shift }
  10.  
  11. package Foo::Baz;
  12. sub new { bless {}, shift }
  13.  
  14. package main;
  15. isa_ok Foo::Bar->new, 'Foo::Bar'; # isa_ok Foo::Bar()->new, 'Foo::Bar'
  16. isa_ok Foo::Bar::->new, 'Foo::Bar'; # 'Foo::Bar'->isa_ok->new, '???'
  17. isa_ok +Foo::Bar->new, 'Foo::Bar'; # isa_ok Foo::Bar()->new, 'Foo::Bar'
  18. isa_ok +Foo::Bar::->new, 'Foo::Bar'; # isa_ok 'Foo::Bar'->new, 'Foo::Bar'
  19.  
  20. isa_ok Foo::Baz->new, 'Foo::Baz'; # 'Foo::Baz'->isa_ok->new, '???'
  21. isa_ok Foo::Baz::->new, 'Foo::Baz'; # 'Foo::Baz'->isa_ok->new, '???'
  22. isa_ok +Foo::Baz->new, 'Foo::Baz'; # isa_ok 'Foo::Baz'->new, 'Foo::Baz'
  23. isa_ok +Foo::Baz::->new, 'Foo::Baz'; # isa_ok 'Foo::Baz'->new, 'Foo::Baz'
  24.  
  25. done_testing;
Add Comment
Please, Sign In to add comment