tagged release 0.7.1
[parrot.git] / t / pmc / config.t
blob1ddc7844e62c75ff125a493378f4d7b5271694ba
1 #! perl
2 # Copyright (C) 2005-2007, The Perl Foundation.
3 # $Id$
5 use strict;
6 use warnings;
7 use lib qw( . lib ../lib ../../lib );
8 use Test::More;
9 use Parrot::Test tests => 3;
10 use Parrot::Config;
11 use Cwd qw(cwd);
13 =head1 NAME
15 t/pmc/config.t - Builtin Config
17 =head1 SYNOPSIS
19     % prove t/pmc/config.t
21 =head1 DESCRIPTION
23 Tests the parrot config interface.
25 =cut
27 pir_output_is( <<'CODE', <<'OUT', "get config hash" );
28 .sub main :main
29     .include "iglobals.pasm"
30     .local pmc config_hash, interp
31     interp = getinterp
32     config_hash = interp[.IGLOBALS_CONFIG_HASH]
33     typeof $S0, config_hash
34     print $S0
35     print "\n"
36 .end
37 CODE
38 Hash
39 OUT
41 pir_output_is( <<'CODE', cwd, "prefix" );
42 .sub main :main
43     .include "iglobals.pasm"
44     .local pmc config_hash, interp
45     interp = getinterp
46     config_hash = interp[.IGLOBALS_CONFIG_HASH]
47     $S0 = config_hash["prefix"]
48     print $S0
49 .end
50 CODE
52 pir_output_is( <<'CODE', <<'OUT', "load src/pbc from library path" );
53 .sub main :main
54     load_bytecode "config.pir"
55     print "ok 1\n"
56     load_bytecode "config.pbc"
57     print "ok 2\n"
58 .end
59 CODE
60 ok 1
61 ok 2
62 OUT
64 # Local Variables:
65 #   mode: cperl
66 #   cperl-indent-level: 4
67 #   fill-column: 100
68 # End:
69 # vim: expandtab shiftwidth=4: