<commit_before>#!perl
# Copyright (C) 2001-2008, Parrot Foundation.
# $Id$

use strict;
use warnings;
use lib qw( lib );

use Cwd 'cwd';

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

use Parrot::Test::Util 'create_tempfile';
use Parrot::Config;
use Parrot::Test tests => 14;

=head1 NAME

syn/file.t - test inclusion of files

=head1 SYNOPSIS

A test script which is supposed to be called by Test::Harness.

=cut

use 5;

# Do not assume that . is in $PATH
my $PARROT = ".$PConfig{slash}parrot$PConfig{exe}";
my $PERL5  = $PConfig{perl};

my $ended_ok = 0;

my ($FOO, $temp_pasm) = create_tempfile( SUFFIX => '.pasm', DIR => cwd(), UNLINK => 1 );

print $FOO <<'ENDF';
  .macro_const BAR 42
ENDF
close $FOO;

pir_output_is( <<"CODE", <<'OUT', 'include pasm' );
.sub test :main
    say "before"
    .include "$temp_pasm"
    print .BAR
    say "\\nafter"
.end
CODE
before
42
after
OUT

($FOO, $temp_pasm) = create_tempfile( SUFFIX => '.pasm', UNLINK => 1 );

print $FOO <<'ENDF';
  .macro_const BAR 42
ENDF
close $FOO;

pir_output_is( <<"CODE", <<'OUT', 'include pasm (absolute path)' );
.sub test :main
    say "before"
    .include '$temp_pasm'<commit_msg>Delete DIR => cwd() key-value pair from one instance of create_tempfile(), in hope that this clears up a testing problem on Cygwin.<commit_after>#!perl
# Copyright (C) 2001-2008, Parrot Foundation.
# $Id$

use strict;
use warnings;
use lib qw( lib );

use Cwd 'cwd';

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

use Parrot::Test::Util 'create_tempfile';
use Parrot::Config;
use Parrot::Test tests => 14;

=head1 NAME

syn/file.t - test inclusion of files

=head1 SYNOPSIS

A test script which is supposed to be called by Test::Harness.

=cut

use 5;

# Do not assume that . is in $PATH
my $PARROT = ".$PConfig{slash}parrot$PConfig{exe}";
my $PERL5  = $PConfig{perl};

my $ended_ok = 0;

#my ($FOO, $temp_pasm) = create_tempfile( SUFFIX => '.pasm', DIR => cwd(), UNLINK => 1 );
my ($FOO, $temp_pasm) = create_tempfile( SUFFIX => '.pasm', UNLINK => 1 );

print $FOO <<'ENDF';
  .macro_const BAR 42
ENDF
close $FOO;

pir_output_is( <<"CODE", <<'OUT', 'include pasm' );
.sub test :main
    say "before"
    .include "$temp_pasm"
    print .BAR
    say "\\nafter"
.end
CODE
before
42
after
OUT

($FOO, $temp_pasm) = create_tempfile( SUFFIX => '.pasm', UNLINK => 1 );

print $FOO <<'ENDF';
  .macro_const BAR 42
ENDF
close $FOO;

pir_output_is( <<"CODE", <<'OUT', 'include pasm (absolute path)' );
.sub test :main
    say "before"
    .include '$temp_pasm'
{'fraction_non_alphanumeric': 0.16223832528180354, 'fraction_numerical': 0.01892109500805153, 'mean_word_length': 4.040567951318458, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7362681', 'n_tokens_mistral': 1035, 'n_tokens_neox': 973, 'n_words': 309}