summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordoy <doy@tozt.net>2009-05-01 18:30:51 -0500
committerdoy <doy@tozt.net>2009-05-01 18:30:51 -0500
commitcac367cb01519969fda3a43c217dfbb009a1f358 (patch)
tree6106b196475a67955bce395ff07383c2ae6cdd41
parent532eee2d51259330856ae6e866c756d6b1e678de (diff)
downloadclass-info-master.tar.gz
class-info-master.zip
simple test scriptHEADmaster
-rw-r--r--test.pl24
1 files changed, 24 insertions, 0 deletions
diff --git a/test.pl b/test.pl
new file mode 100644
index 0000000..ffc89a6
--- /dev/null
+++ b/test.pl
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+use Class::Info;
+my $info = Class::Info->new('NetHack::Item::Potion');
+my $methods = $info->classify_methods;
+print "Local methods:\n";
+print " " . $_->as_string . "\n" for @{ $methods->{local} };
+print "Role methods:\n";
+my $role_methods = $methods->{composed};
+for my $role (keys %$role_methods) {
+ print " " . $_->as_string . "\n" for @{ $role_methods->{$role} };
+}
+print "Inherited methods:\n";
+my $inherited_methods = $methods->{inherited};
+for my $inherit (keys %$inherited_methods) {
+ print " " . $_->as_string . "\n" for @{ $inherited_methods->{$inherit} };
+}
+print "Imported methods:\n";
+my $imports = $methods->{imports};
+for my $import (keys %$imports) {
+ print " " . $_->as_string . "\n" for @{ $imports->{$import} };
+}