aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pyre2/py3/tests/test_count.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/py3/tests/test_count.txt
parentcb2c8d75065e5b3c47094067cb4aa407d4813298 (diff)
downloadydb-0a98fece5a9b54f16afeb3a94b3eb3105e9c3962.tar.gz
YQ Connector:Use docker-compose in integrational tests
Diffstat (limited to 'contrib/python/pyre2/py3/tests/test_count.txt')
-rw-r--r--contrib/python/pyre2/py3/tests/test_count.txt40
1 files changed, 40 insertions, 0 deletions
diff --git a/contrib/python/pyre2/py3/tests/test_count.txt b/contrib/python/pyre2/py3/tests/test_count.txt
new file mode 100644
index 0000000000..ce3525adc5
--- /dev/null
+++ b/contrib/python/pyre2/py3/tests/test_count.txt
@@ -0,0 +1,40 @@
+count tests
+===========
+
+ >>> import re2
+ >>> re2.set_fallback_notification(re2.FALLBACK_EXCEPTION)
+
+This one is from http://docs.python.org/library/re.html?#finding-all-adverbs:
+
+ >>> re2.count(r"\w+ly", "He was carefully disguised but captured quickly by police.")
+ 2
+
+Groups should not affect count():
+
+ >>> re2.count(r"(\w+)=(\d+)", "foo=1,foo=2")
+ 2
+ >>> re2.count(r"(\w)\w", "fx")
+ 1
+
+Zero matches:
+
+ >>> re2.count("(f)", "gggg")
+ 0
+
+A pattern matching an empty string:
+
+ >>> re2.count(".*", "foo")
+ 2
+
+ >>> re2.count("", "foo")
+ 4
+
+contains tests
+==============
+
+ >>> re2.contains('a', 'bbabb')
+ True
+ >>> re2.contains('a', 'bbbbb')
+ False
+
+ >>> re2.set_fallback_notification(re2.FALLBACK_QUIETLY)