clean up newline handling for cli mode output
Matt S Trout [Fri, 23 Sep 2011 14:19:53 +0000 (14:19 +0000)]
lib/Web/Simple/Application.pm

index fdf8369..9272b91 100644 (file)
@@ -102,7 +102,9 @@ sub _run_test_request {
   );
   print STDERR $response->status_line."\n";
   print STDERR $response->headers_as_string("\n")."\n";
-  print STDOUT $response->content."\n";
+  my $content = $response->content;
+  $content .= "\n" if length($content) and $content !~ /\n\z/;
+  print STDOUT $content if $content;
 }
 
 sub _run_cli {