Added test to check handling of the case of a too small dictionary

This commit is contained in:
Julian Weigt 2016-08-11 15:06:24 +02:00
parent d4f30bd100
commit 6973c93fa7
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<!-- target: hello.txt -->
<html>
<head>
<meta charset="utf-8">
<title>Many links</title>
</head>
<body>
<a href="/data/hello.txt">1</a>
<a href="/data/hello.txt">2</a>
<a href="/data/hello.txt">3</a>
<a href="/data/hello.txt">4</a>
</body>
</html>

View File

@ -113,3 +113,17 @@ def test_word_hints_issue1393(quteproc, tmpdir):
quteproc.wait_for(message='hints: *', category='hints')
quteproc.send_cmd(':follow-hint {}'.format(hint))
quteproc.wait_for_load_finished('data/{}'.format(target))
def test_short_dict(quteproc,tmpdir):
dict_file = tmpdir / 'dict'
dict_file.write(textwrap.dedent("""
a
b
"""))
quteproc.set_setting('hints', 'mode', 'word')
quteproc.set_setting('hints', 'dictionary', str(dict_file))
quteproc.open_path('data/hints/short_dict.html')
quteproc.send_cmd(':hint')
line = quteproc.wait_for(message='Not enough words in the dictionary.')
line.expected = True
quteproc.wait_for(message='hints: *', category='hints')