#!perl

# Copyright (C) 2006-2008, The Perl Foundation.
# $Id: $

use strict;
use warnings;

use Test::More;
use File::Spec;

my $perl6_pbc = File::Spec->catfile( '..', '..', 'languages', 'perl6', 'perl6.pbc' );
plan skip_all => "Need to first run make in languages/perl6" if not -e $perl6_pbc;

plan tests => 6;

use_ok('Parrot::Embed') or exit;

my $module = 'Parrot::Interpreter';
my $interp = $module->new();
ok( $interp, 'new() should return a valid interpreter' );
isa_ok( $interp, $module );

my $result = eval { $interp->load_file($perl6_pbc) };
my $except = $@;
ok( $result, '... returning true if it could load the file' );
is( $except, '', '... throwing no exeption if so' );

my $perl6 = $interp->find_global( 'main', 'Perl6', 'Compiler' );
isa_ok( $perl6, 'Parrot::PMC' );

