Ticket #77: perl6.t

File perl6.t, 0.8 KB (added by szabgab, 6 years ago)

ext/Parrot-Embed/t/perl6.t

Line 
1#!perl
2
3# Copyright (C) 2006-2008, The Perl Foundation.
4# $Id: $
5
6use strict;
7use warnings;
8
9use Test::More;
10use File::Spec;
11
12my $perl6_pbc = File::Spec->catfile( '..', '..', 'languages', 'perl6', 'perl6.pbc' );
13plan skip_all => "Need to first run make in languages/perl6" if not -e $perl6_pbc;
14
15plan tests => 6;
16
17use_ok('Parrot::Embed') or exit;
18
19my $module = 'Parrot::Interpreter';
20my $interp = $module->new();
21ok( $interp, 'new() should return a valid interpreter' );
22isa_ok( $interp, $module );
23
24my $result = eval { $interp->load_file($perl6_pbc) };
25my $except = $@;
26ok( $result, '... returning true if it could load the file' );
27is( $except, '', '... throwing no exeption if so' );
28
29my $perl6 = $interp->find_global( 'main', 'Perl6', 'Compiler' );
30isa_ok( $perl6, 'Parrot::PMC' );
31