aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorPedro Worcel <pedro@worcel.com>2014-02-22 15:32:35 +1300
committerPedro Worcel <pedro@worcel.com>2014-02-22 15:32:35 +1300
commit3c02865e8b5839d536bc9982e4c0e6e699fd1943 (patch)
tree9eb909a26bfe95003420a308374b3e0375437261 /test
parent7a154e1ae18f12056447ef030b2bb321cfb13111 (diff)
downloadmitmproxy-3c02865e8b5839d536bc9982e4c0e6e699fd1943.tar.gz
mitmproxy-3c02865e8b5839d536bc9982e4c0e6e699fd1943.tar.bz2
mitmproxy-3c02865e8b5839d536bc9982e4c0e6e699fd1943.zip
add multi-line support
Diffstat (limited to 'test')
-rw-r--r--test/test_console_search.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_console_search.py b/test/test_console_search.py
index 7374f399..69c033b9 100644
--- a/test/test_console_search.py
+++ b/test/test_console_search.py
@@ -119,3 +119,18 @@ def test_search_backwards():
text_object = tutils.get_body_line(f.last_displayed_body, 0)
assert text_object.get_text() == first_match
+def test_search_back_multiline():
+ f = tutils.tflowview(request_contents="this is string\nstring is string")
+
+ f.search("string")
+ text_object = tutils.get_body_line(f.last_displayed_body, 0)
+ first_match = ('this is string', [(None, 8), (f.highlight_color, 6)])
+ assert text_object.get_text() == first_match
+
+ f.search_again()
+ text_object = tutils.get_body_line(f.last_displayed_body, 1)
+ assert text_object.get_text() == ('string is string', [(None, 0), (f.highlight_color, 6)])
+
+ f.search_again(backwards=True)
+ text_object = tutils.get_body_line(f.last_displayed_body, 0)
+ assert text_object.get_text() == first_match