root/trunk/POE-Session-Magic/msesstest.pl

Revision 13, 1.5 kB (checked in by scottmc, 3 years ago)

Added old perl modules
Starting to think maybe I should structure the new repository differently

Line 
1#!/usr/bin/perl -l
2
3use warnings FATAL => "all";
4use strict;
5
6use POE qw( Session::Magic );
7use MSTest;
8
9my %Scope;
10
11sub _stop : Object {
12    print $Scope{Test};
13    print "Exiting...";
14}
15
16sub ptest : Inline {
17    print Heap->{Test};
18    print shift;
19
20#    MSTest->test("Testing cross-package post");
21#    post(MSTest => test => "Testing cross-package post");
22
23    require MSDynload;
24}
25
26sub foo : Inline {
27    print shift;
28    Heap->{Test} = "Testing Heap Passing";
29    ptest "Testing Package States";
30
31    my $STest;
32    my $fokey;
33
34    unless (defined $Scope{Spawned}) {
35        print "Testing Session duplication";
36        $fokey = main->spawn;
37        print "The reference of fokey is ", ref $fokey;
38
39        ptest "Is this dereferencing right?";
40        main->ptest("\$fokey->ptest(\"This is a test\");");
41
42        $fokey->ptest("This is a test");
43        $fokey->ptest("These object aliases aren't actually objects..");
44
45        unless ($fokey->can("ptest")) {
46            print "\$fokey = $fokey";
47            print " .. But \$fokey cant ->ptest";
48        }
49
50        MSTest->spawn("JOKE");
51
52        $STest = JOKE->spawn;
53        $STest->test("This is a test of a object alias");
54        JOKE->test("This tests a spawned package alias as a package method");
55        JOKE->destroy;
56
57        $Scope{Spawned} = 1;
58    }
59
60}
61
62sub _start : Inline {
63    print "Starting Up";
64    foo "Running";
65   
66    $Scope{Test} = "Scope test";
67}
68
69# This doesn't need an attribute...
70sub new {
71    print "New called";
72    bless {};
73} # To appease object states creator
Note: See TracBrowser for help on using the browser.