Author: particle
Date: Mon Dec 15 12:30:01 2008
New Revision: 33934
Modified:
trunk/t/compilers/pct/complete_workflow.t
Log:
[t] slight refactoring for readability
Modified: trunk/t/compilers/pct/complete_workflow.t
==============================================================================
--- trunk/t/compilers/pct/complete_workflow.t (original)
+++ trunk/t/compilers/pct/complete_workflow.t Mon Dec 15 12:30:01 2008
@@ -298,7 +298,7 @@
}
-# 10 test cases in this sub
+# 9 test cases in this sub
sub test_pct
{
my ( $test_name, $in, $grammar, $actions, $out, @other ) = @_;
@@ -312,6 +312,11 @@
my $PERL6GRAMMAR = "$PGE_LIBRARY/Perl6Grammar.pbc";
my $NQP = "$BUILD_DIR/compilers/nqp/nqp.pbc";
+ my $tempfile_opts = {
+ DIR => $TEST_DIR,
+ UNLINK => 1,
+ };
+
my $sample_fn = 'complete_workflow_sample_input.txt';
Parrot::Test::write_code_to_file( $in, $sample_fn );
@@ -343,7 +348,7 @@
EOT
# set up a file with the grammar
- my ($PG, $pg_fn) = create_tempfile( SUFFIX => '.pg', DIR => $TEST_DIR,
UNLINK => 1 );
+ my ($PG, $pg_fn) = create_tempfile( SUFFIX => '.pg', %$tempfile_opts );
print $PG <<"EOT";
# DO NOT EDIT.
# This file was generated by t/compilers/pct/complete_workflow.t
@@ -370,6 +375,7 @@
ok( -e $gen_parser_fn, "$test_name: generated parser exist" );
my $gen_parser = slurp_file($gen_parser_fn);
unlink $gen_parser_fn;
+
$pir_code .= <<"EOT";
#------------------------------#
# The generated parser #
@@ -381,7 +387,7 @@
# set up a file with the actions
- my ($PM, $pm_fn) = create_tempfile( SUFFIX => '.pm', DIR => $TEST_DIR,
UNLINK => 1 );
+ my ($PM, $pm_fn) = create_tempfile( SUFFIX => '.pm', %$tempfile_opts );
print $PM <<"EOT";
# DO NOT EDIT.
# This file was generated by t/compilers/pct/complete_workflow.t
@@ -419,7 +425,7 @@
EOT
- pir_output_is( $pir_code, $out , "$test_name: output of compiler", @other
);
+ pir_output_is( $pir_code, $out, "$test_name: output of compiler", @other );
unlink $sample_fn;