fix codetest failure - ASSERT_ARGS does not have a ; after and
[parrot.git] / t / pmc / handle.t
blob4ad2c53ad68b11d68a995ff96fbe68d1293fb8c1
1 #!./parrot
2 # Copyright (C) 2001-2010, Parrot Foundation.
3 # $Id$
5 =head1 NAME
7 t/pmc/handle.t - Handle basic type
9 =head1 SYNOPSIS
11     % prove t/pmc/handle.t
13 =head1 DESCRIPTION
15 Tests the Handle PMC. Handle is abstract, so no real tests of functionality
16 here.
18 =cut
20 .sub main :main
21     .include 'test_more.pir'
23     plan(3)
24     'test_create'()
25     'test_does_tt_1473'()
26 .end
28 .sub 'test_create'
29     push_eh cant_instantiate
30     $P0 = new 'Handle'
31     ok(0, "Can instantiate an abstract type")
32     pop_eh
33     goto create_end
34   cant_instantiate:
35     ok(1, "Cannot instantiate an abstract type")
36     pop_eh
37   create_end:
39     $P1 = new ['String']
40     push_eh cant_instantiate_arg
41     $P0 = new ['Handle'], $P1
42     ok(0, "Can instantiate an abstract type with arg")
43     pop_eh
44     goto create_end_arg
45   cant_instantiate_arg:
46     ok(1, "Cannot instantiate an abstract type with arg")
47     pop_eh
48   create_end_arg:
49 .end
51 .sub 'test_does_tt_1473'
52     push_eh cant_do_does
53     $P0 = get_class 'Handle'
54     $I0 = does $P0, 'Handle'
55     ok($I0, "Handle does Handle")
56     goto does_end
57   cant_do_does:
58     ok(0, "Does throws an exception")
59   does_end:
60     pop_eh
61 .end
64 # Local Variables:
65 #   mode: pir
66 #   fill-column: 100
67 # End:
68 # vim: expandtab shiftwidth=4 ft=pir: