-
Notifications
You must be signed in to change notification settings - Fork 1
/
say.t
103 lines (85 loc) · 1.55 KB
/
say.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!perl
# Copyright (C) 2001-2008, Parrot Foundation.
# $Id$
use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Test tests => 8;
=head1 NAME
t/op/say.t - Testing the say pseudo-opcode
=head1 SYNOPSIS
% prove t/op/say.t
=head1 DESCRIPTION
Tests various PMCs and registers with say.
=cut
pir_output_is( <<'CODE', <<'OUTPUT', 'say with a literal string' );
.sub main
say "string literal"
.end
CODE
string literal
OUTPUT
pir_output_is( <<'CODE', <<'OUTPUT', 'say with a literal integer' );
.sub main
say 42
.end
CODE
42
OUTPUT
pir_output_is( <<'CODE', <<'OUTPUT', 'say with a literal number' );
.sub main
say 3.14
.end
CODE
3.14
OUTPUT
pir_output_is( <<'CODE', <<'OUTPUT', 'say with a temporary string register' );
.sub main
$S5 = "string register"
say $S5
.end
CODE
string register
OUTPUT
pir_output_is( <<'CODE', <<'OUTPUT', 'say with a temporary integer register' );
.sub main
$I4 = 10
say $I4
.end
CODE
10
OUTPUT
pir_output_is( <<'CODE', <<'OUTPUT', 'say with a temporary number register' );
.sub main
$N2 = 1.414
say $N2
.end
CODE
1.414
OUTPUT
pir_output_is( <<'CODE', <<'OUTPUT', 'say and print with a number register' );
.sub main
$N0 = 3.14159
say $N0
print $N0
print "\n"
.end
CODE
3.14159
3.14159
OUTPUT
pir_error_output_like( <<'CODE', <<'OUTPUT', 'say with PMCNULL argument' );
.sub 'main'
null $P0
say $P0
.end
CODE
/Null PMC in say/
OUTPUT
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: