about summary refs log tree commit homepage
path: root/test/test_watcher.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-10-12 14:00:23 -0700
committerEric Wong <normalperson@yhbt.net>2011-10-12 14:00:23 -0700
commitd5fc6f66bc17f27770b38126b6c4211fd938c5b5 (patch)
tree946d7be0f4f5aa57318abe220e354d6590519131 /test/test_watcher.rb
parent360b8569cbb2b795019db278463245cce4270d09 (diff)
downloadraindrops-d5fc6f66bc17f27770b38126b6c4211fd938c5b5.tar.gz
Just in case somebody tries to scan all addresses, we
won't run out of memory as easily.
Diffstat (limited to 'test/test_watcher.rb')
-rw-r--r--test/test_watcher.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_watcher.rb b/test/test_watcher.rb
index f22a954..056a3bf 100644
--- a/test/test_watcher.rb
+++ b/test/test_watcher.rb
@@ -43,6 +43,20 @@ class TestWatcher < Test::Unit::TestCase
     check_headers(resp.headers)
   end
 
+  def test_invalid
+    assert_nothing_raised do
+      @req.get("/active/666.666.666.666%3A666.txt")
+      @req.get("/queued/666.666.666.666%3A666.txt")
+      @req.get("/active/666.666.666.666%3A666.html")
+      @req.get("/queued/666.666.666.666%3A666.html")
+    end
+    addr = @app.instance_eval do
+      @peak_active.keys + @peak_queued.keys +
+         @resets.keys + @active.keys + @queued.keys
+    end
+    assert addr.grep(/666\.666\.666\.666/).empty?, addr.inspect
+  end
+
   def test_active_html
     resp = @req.get "/active/#@addr.html"
     assert_equal 200, resp.status.to_i