Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Convert tmp_file variable to kebab-case
This is merely to be consistent with other variable names in the same files.
  • Loading branch information
Paul Cochrane committed Apr 13, 2015
1 parent 16df8ce commit bbeb540
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions t/nqp/19-file-ops.t
Expand Up @@ -167,12 +167,12 @@ nqp::unlink($test-file ~ '-linked');

# symlink

my $tmp_file := "tmp";
my $tmp-file := "tmp";
my $env := nqp::getenvhash();
$env<NQP_SHELL_TEST_ENV_VAR> := "123foo";
nqp::shell("echo %NQP_SHELL_TEST_ENV_VAR% > $tmp_file",nqp::cwd(),$env);
my $output := slurp($tmp_file);
nqp::unlink($tmp_file);
nqp::shell("echo %NQP_SHELL_TEST_ENV_VAR% > $tmp-file",nqp::cwd(),$env);
my $output := slurp($tmp-file);
nqp::unlink($tmp-file);
my $is-windows := $output ne "%NQP_SHELL_TEST_ENV_VAR%\n";

if $is-windows {
Expand Down
16 changes: 8 additions & 8 deletions t/nqp/78-shell.t
Expand Up @@ -9,21 +9,21 @@ ok(nqp::ishash($a),'nqp::getenvhash() returns a hash');
ok($a<foo> == 123,'nqp::getenvhash() is a fresh hash');
ok($b<foo> == 456,'nqp::getenvhash() is a fresh hash');

my $tmp_file := "tmp";
nqp::shell("echo Hello > $tmp_file",nqp::cwd(),nqp::getenvhash());
my $output := slurp($tmp_file);
my $tmp-file := "tmp";
nqp::shell("echo Hello > $tmp-file",nqp::cwd(),nqp::getenvhash());
my $output := slurp($tmp-file);
ok($output ~~ /^Hello/,'nqp::shell works with the echo shell command');

my $env := nqp::getenvhash();
$env<NQP_SHELL_TEST_ENV_VAR> := "123foo";

nqp::shell("echo %NQP_SHELL_TEST_ENV_VAR% > $tmp_file",nqp::cwd(),$env);
$output := slurp($tmp_file);
nqp::shell("echo %NQP_SHELL_TEST_ENV_VAR% > $tmp-file",nqp::cwd(),$env);
$output := slurp($tmp-file);
if $output eq "%NQP_SHELL_TEST_ENV_VAR%\n" {
nqp::shell("echo \$NQP_SHELL_TEST_ENV_VAR > $tmp_file",nqp::cwd(),$env);
my $output := slurp($tmp_file);
nqp::shell("echo \$NQP_SHELL_TEST_ENV_VAR > $tmp-file",nqp::cwd(),$env);
my $output := slurp($tmp-file);
ok($output eq "123foo\n","passing env variables to child processes works linux");
} else {
ok($output ~~ /^123foo/,"passing env variables to child processes works on windows");
}
nqp::unlink($tmp_file);
nqp::unlink($tmp-file);

0 comments on commit bbeb540

Please sign in to comment.