Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make IO::Socket tests not sensitive to magical \n.
  • Loading branch information
jnthn committed Nov 5, 2015
1 parent 72bb826 commit 238fd35
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions S32-io/IO-Socket-INET.bat
Expand Up @@ -8,9 +8,9 @@ SET PORT=%2
DEL t\spec\S32-io\server-ready-flag 2> NUL

:: Use START to fork the server and set the window title so we can kill it later
START "P6IOSOCKETtest" /MIN %PERL6_BINARY% t\spec\S32-io\IO-Socket-INET.pl %TEST% %PORT% server
START "P6IOSOCKETtest" /MIN %PERL6_BINARY% -Ilib t\spec\S32-io\IO-Socket-INET.pl %TEST% %PORT% server

CALL %PERL6_BINARY% t\spec\S32-io\IO-Socket-INET.pl %TEST% %PORT% client
CALL %PERL6_BINARY% -Ilib t\spec\S32-io\IO-Socket-INET.pl %TEST% %PORT% client

:: Clean up any stray processes
TASKKILL /F /T /FI "WINDOWTITLE eq P6IOSOCKETtest*" > NUL
1 change: 1 addition & 0 deletions S32-io/IO-Socket-INET.pl
Expand Up @@ -123,6 +123,7 @@
$fd.close();
while my $client = $server.accept() {
# default line separator
use newline :lf;
$client.print("'Twas brillig, and the slithy toves\n");
$client.print("Did gyre and gimble in the wabe;\n");
# custom line separator: \r\n
Expand Down
4 changes: 2 additions & 2 deletions S32-io/IO-Socket-INET.sh
Expand Up @@ -8,10 +8,10 @@ PORT="$2"
rm t/spec/S32-io/server-ready-flag 2>/dev/null

# use & to run the server as a background process
$PERL6_BINARY t/spec/S32-io/IO-Socket-INET.pl $TEST $PORT server & SERVER=$!
$PERL6_BINARY -Ilib t/spec/S32-io/IO-Socket-INET.pl $TEST $PORT server & SERVER=$!

# use & to run the client as a background process
$PERL6_BINARY t/spec/S32-io/IO-Socket-INET.pl $TEST $PORT client & CLIENT=$!
$PERL6_BINARY -Ilib t/spec/S32-io/IO-Socket-INET.pl $TEST $PORT client & CLIENT=$!

# make a watchdog to kill a hanging client (occurs only if a test fails)
#( sleep 20; kill $CLIENT 2>/dev/null && echo '(timeout)' ) &
Expand Down

0 comments on commit 238fd35

Please sign in to comment.