aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pyre2/py2/tests/test_search.txt
diff options
context:
space:
mode:
authorvitalyisaev <vitalyisaev@ydb.tech>2023-11-30 13:26:22 +0300
committervitalyisaev <vitalyisaev@ydb.tech>2023-11-30 15:44:45 +0300
commit0a98fece5a9b54f16afeb3a94b3eb3105e9c3962 (patch)
tree291d72dbd7e9865399f668c84d11ed86fb190bbf /contrib/python/pyre2/py2/tests/test_search.txt
parentcb2c8d75065e5b3c47094067cb4aa407d4813298 (diff)
downloadydb-0a98fece5a9b54f16afeb3a94b3eb3105e9c3962.tar.gz
YQ Connector:Use docker-compose in integrational tests
Diffstat (limited to 'contrib/python/pyre2/py2/tests/test_search.txt')
-rw-r--r--contrib/python/pyre2/py2/tests/test_search.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/contrib/python/pyre2/py2/tests/test_search.txt b/contrib/python/pyre2/py2/tests/test_search.txt
new file mode 100644
index 0000000000..9c1e18f08c
--- /dev/null
+++ b/contrib/python/pyre2/py2/tests/test_search.txt
@@ -0,0 +1,29 @@
+These are simple tests of the ``search`` function
+=================================================
+
+ >>> import re2
+ >>> re2.set_fallback_notification(re2.FALLBACK_EXCEPTION)
+ >>> import warnings
+ >>> warnings.filterwarnings('ignore', category=DeprecationWarning)
+
+ >>> re2.search("((?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])", "hello 28.224.2.1 test").group()
+ '28.224.2.1'
+
+ >>> re2.search("(\d{3})\D?(\d{3})\D?(\d{4})", "800-555-1212").groups()
+ ('800', '555', '1212')
+
+ >>> input = 'a' * 999
+ >>> len(re2.search('(?:a{1000})?a{999}', input).group())
+ 999
+
+ >>> with open('tests/cnn_homepage.dat') as tmp:
+ ... data = tmp.read()
+ >>> re2.search(r'\n#hdr-editions(.*?)\n', data).groups()
+ (' a { text-decoration:none; }',)
+
+Verify some sanity checks
+
+ >>> re2.compile(r'x').search('x', 2000)
+ >>> re2.compile(r'x').search('x', 1, -300)
+
+ >>> re2.set_fallback_notification(re2.FALLBACK_QUIETLY)