about summary refs log tree commit homepage
path: root/test
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-04-08 14:36:36 -0700
committerEric Wong <normalperson@yhbt.net>2010-04-08 14:57:52 -0700
commit31925d90c3d292d0b5f20524082b7d3dc2e08fcb (patch)
treee23c2d927b3eba08dc107adf9aaba85a75ffe424 /test
parent724c1f6a3b42a020199554c809a46ddc4b404659 (diff)
downloadclogger-31925d90c3d292d0b5f20524082b7d3dc2e08fcb.tar.gz
They're slightly faster when we know a number is small enough
to be a FIXNUM.
Diffstat (limited to 'test')
-rw-r--r--test/test_clogger.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_clogger.rb b/test/test_clogger.rb
index 4dab3fc..42cab1c 100644
--- a/test/test_clogger.rb
+++ b/test/test_clogger.rb
@@ -587,6 +587,24 @@ class TestClogger < Test::Unit::TestCase
     assert ! cl.reentrant?
   end
 
+  def test_invalid_status
+    s = []
+    body = []
+    app = lambda { |env| [ env["force.status"], [ %w(a b) ], body ] }
+    o = { :logger => s, :format => "$status" }
+    cl = Clogger.new(app, o)
+    status, headers, body = cl.call(@req.merge("force.status" => -1))
+    assert_equal -1, status
+    assert_equal "-\n", s.last
+    status, headers, body = cl.call(@req.merge("force.status" => 1000))
+    assert_equal 1000, status
+    assert_equal "-\n", s.last
+    u64_max = 0xffffffffffffffff
+    status, headers, body = cl.call(@req.merge("force.status" => u64_max))
+    assert_equal u64_max, status
+    assert_equal "-\n", s.last
+  end
+
   # so we don't  care about the portability of this test
   # if it doesn't leak on Linux, it won't leak anywhere else
   # unless your C compiler or platform is otherwise broken