/
cat.t
47 lines (32 loc) · 935 Bytes
/
cat.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
# Copyright (C) 2005-2009, The Perl Foundation.
# $Id$
=head1 NAME
lazy-k/t/cat.t - testing cat.lazy
=head1 SYNOPSIS
% cd languages/lazy-k && perl t/cat.t
=head1 DESCRIPTION
Test cat.lazy.
=head1 AUTHOR
Bernhard Schmalhofer - C<Bernhard.Schmalhofer@gmx.de>
=cut
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../../../lib";
use Test::More tests => 1;
use Parrot::Config qw(%PConfig);
use File::Spec ();
my $is_win32 = $^O eq 'MSWin32';
my $parrot = File::Spec->catfile( File::Spec->updir(), File::Spec->updir(), $PConfig{test_prog} );
my $lazy_k = "$parrot lazy.pbc";
my $source_fn = 'examples/cat.lazy';
# XXX This does not look portable.
my $cmd;
if ($is_win32) {
# Don't quote the string on Windows, it is passed on literally
$cmd = qq{echo 1+2*3 | $lazy_k $source_fn};
}
else {
$cmd = qq{echo '1+2*3' | $lazy_k $source_fn};
}
is( `$cmd`, "1+2*3\n", 'cat.lazy' );