Fix the case for body '0'
[catagits/Catalyst-Runtime.git] / t / aggregate / live_engine_response_emptybody.t
diff --git a/t/aggregate/live_engine_response_emptybody.t b/t/aggregate/live_engine_response_emptybody.t
new file mode 100644 (file)
index 0000000..c4d6dec
--- /dev/null
@@ -0,0 +1,27 @@
+#!perl
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/../lib";
+
+use Test::More;
+use Catalyst::Test 'TestApp';
+
+# body '0'
+{
+    my $res = request('/zerobody');
+    is $res->content, '0';
+    is $res->header('Content-Length'), '1';
+}
+
+# body ''
+{
+    my $res = request('/emptybody');
+    is $res->content, '';
+    ok !$res->header('Content-Length');
+}
+
+done_testing;
+