Permalink
Browse files

Perlito5 - tests - add AUTOLOAD tests

  • Loading branch information...
fglock committed Nov 21, 2012
1 parent 98415bf commit 8d65dd4de76f5f51e204a69a3227ec4d9ad9f035
Showing with 28 additions and 0 deletions.
  1. +28 −0 t5/01-perlito/32-autoload-method.t
@@ -0,0 +1,28 @@
+use feature 'say';
+use strict;
+
+say "1..4";
+
+{
+ package A;
+
+ our $AUTOLOAD;
+
+ sub AUTOLOAD {
+ say "# A::AUTOLOAD @_";
+ print "not " if $_[0] ne 'A';
+ say "ok 1";
+ print "not " if $_[1] != 123;
+ say "ok 2";
+ say "# $AUTOLOAD";
+ print "not " if $AUTOLOAD ne "A::a";
+ say "ok 3";
+ return 456;
+ }
+
+ my $v = A->a(123);
+ print "not " if $v != 456;
+ say "ok 4";
+}
+
+

0 comments on commit 8d65dd4

Please sign in to comment.