-
Notifications
You must be signed in to change notification settings - Fork 138
/
nativepccmethod.t
55 lines (41 loc) · 990 Bytes
/
nativepccmethod.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!./parrot
# Copyright (C) 2001-2009, Parrot Foundation.
=head1 NAME
t/pmc/nativepccmethod.t - NativePCCMethods
=head1 SYNOPSIS
% prove t/pmc/nativepccmethod.t
=head1 DESCRIPTION
Tests the C<NativePCCMethod> PMC.
=cut
.sub main :main
.include 'test_more.pir'
plan(4)
test_call_null()
test_clone()
test_defined()
.end
.sub test_call_null
throws_substring(<<"CODE", "attempt to call NULL native function", "cannot call NULL native function")
.sub main
$P0 = new ['NativePCCMethod']
$P0()
.end
CODE
.end
.sub test_clone
$P0 = new ['NativePCCMethod']
$P1 = clone $P0
ok(1, "can clone NativePCCMethod")
.end
.sub test_defined
$P0 = new ['NativePCCMethod']
$I0 = isfalse $P0
is($I0, 1, "undefined NativePCCMethod is false")
$I1 = get_addr $P0
is($I1, 0, "undefined NativePCCMethod points to null")
.end
# Local Variables:
# mode: pir
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir: