diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-11-25 18:58:33 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-11-25 18:58:33 +0100 |
commit | 9e1ab361729a3ccad8ce2d0afb2d5c4230eddeb4 (patch) | |
tree | 3444e12457f542cb7ce0ca9319ce93e25dadaa89 /tests/unit/completion/test_models.py | |
parent | ff96894f18ba5b7d6c5d2f3282d63599c9709b52 (diff) | |
download | qutebrowser-9e1ab361729a3ccad8ce2d0afb2d5c4230eddeb4.tar.gz qutebrowser-9e1ab361729a3ccad8ce2d0afb2d5c4230eddeb4.zip |
Make sure all Qt regexes are valid
Diffstat (limited to 'tests/unit/completion/test_models.py')
-rw-r--r-- | tests/unit/completion/test_models.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/unit/completion/test_models.py b/tests/unit/completion/test_models.py index 2ac7084dd..8b4653b58 100644 --- a/tests/unit/completion/test_models.py +++ b/tests/unit/completion/test_models.py @@ -26,6 +26,8 @@ import time from datetime import datetime from unittest import mock +import hypothesis +import hypothesis.strategies import pytest from PyQt5.QtCore import QUrl, QDateTime try: @@ -37,7 +39,8 @@ except ImportError: from qutebrowser.misc import objects from qutebrowser.completion import completer -from qutebrowser.completion.models import miscmodels, urlmodel, configmodel +from qutebrowser.completion.models import ( + miscmodels, urlmodel, configmodel, listcategory) from qutebrowser.config import configdata, configtypes from qutebrowser.utils import usertypes from qutebrowser.mainwindow import tabbedbrowser @@ -1324,3 +1327,10 @@ def test_undo_completion(tabbed_browser_stubs, info): "2020-01-01 00:00"), ], }) + + +@hypothesis.given(text=hypothesis.strategies.text()) +def test_listcategory_hypothesis(text): + """Make sure we can't produce invalid patterns.""" + cat = listcategory.ListCategory("test", []) + cat.set_pattern(text) |