Skip to content

Commit

Permalink
Renamed ipc.pl because now it's almost a test file
Browse files Browse the repository at this point in the history
  • Loading branch information
soh-cah-toa committed Jun 22, 2011
1 parent 1e6a0e1 commit 199bb25
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ipc.pl → ipc.t
Expand Up @@ -9,7 +9,7 @@
use Symbol;
use Test::More;

use Parrot::Test::HBDB;
use Parrot::Test::HBDB tests => 1;

# TODO Signal handler for SIGPIPE

Expand All @@ -24,7 +24,7 @@
my $hbdb = "./hbdb hello.pbc";

# Not used yet
my $bad_cmd = qr/Undefined command: "\w+". Try "help"./;
my $bad_cmd = qr/(hbdb) Undefined command: "\w+". Try "help"./;

# Run hbdb
$pid = open3(\*HBDB_STDIN, \*HBDB_STDOUT, \*HBDB_STDERR, $hbdb);
Expand All @@ -50,10 +50,9 @@

# Check whether it's STDOUT or STDERR
if (fileno($fd) == fileno(\*HBDB_STDERR)) {
print "HBDB_STDERR: $_" while <HBDB_STDERR>;
}
else {
print "HBDB_STDOUT: $_" while <HBDB_STDOUT>;
my @lines = <HBDB_STDERR>;

like($lines[0], $bad_cmd, "Test bad command");
}

# Remove filehandle from list if reached EOF
Expand Down

0 comments on commit 199bb25

Please sign in to comment.