Skip to content
This repository
Browse code

Perlito5 - tests - add AUTOLOAD tests

  • Loading branch information...
commit 8d65dd4de76f5f51e204a69a3227ec4d9ad9f035 1 parent 98415bf
Flavio S. Glock authored November 21, 2012

Showing 1 changed file with 28 additions and 0 deletions. Show diff stats Hide diff stats

  1. 28  t5/01-perlito/32-autoload-method.t
28  t5/01-perlito/32-autoload-method.t
... ...
@@ -0,0 +1,28 @@
  1
+use feature 'say';
  2
+use strict;
  3
+
  4
+say "1..4";
  5
+
  6
+{
  7
+    package A;
  8
+
  9
+    our $AUTOLOAD;
  10
+
  11
+    sub AUTOLOAD {
  12
+        say "# A::AUTOLOAD @_";
  13
+        print "not " if $_[0] ne 'A';
  14
+        say "ok 1";
  15
+        print "not " if $_[1] != 123;
  16
+        say "ok 2";
  17
+        say "# $AUTOLOAD";
  18
+        print "not " if $AUTOLOAD ne "A::a";
  19
+        say "ok 3";
  20
+        return 456;
  21
+    }
  22
+
  23
+    my $v = A->a(123);
  24
+        print "not " if $v != 456;
  25
+        say "ok 4";
  26
+}
  27
+
  28
+

0 notes on commit 8d65dd4

Please sign in to comment.
Something went wrong with that request. Please try again.