summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-11-22 14:30:38 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-11-22 14:30:38 (GMT)
commitbcf4dccfa77df6fd75181e2a7cbfbf2d4b2c6255 (patch)
tree000475f7e8e7c173eab2743d901f00b3c01b7db0 /Lib/test/test_re.py
parente670b2d5c39ce6ac72890e52e9d505f90c33ccba (diff)
downloadcpython-bcf4dccfa77df6fd75181e2a7cbfbf2d4b2c6255.zip
cpython-bcf4dccfa77df6fd75181e2a7cbfbf2d4b2c6255.tar.gz
cpython-bcf4dccfa77df6fd75181e2a7cbfbf2d4b2c6255.tar.bz2
Issue #28727: Optimize pattern_richcompare() for a==a
A pattern is equal to itself.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 4fcd2d4..84131d2 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1781,6 +1781,10 @@ SUBPATTERN None 0 0
def test_pattern_compare(self):
pattern1 = re.compile('abc', re.IGNORECASE)
+ # equal to itself
+ self.assertEqual(pattern1, pattern1)
+ self.assertFalse(pattern1 != pattern1)
+
# equal
re.purge()
pattern2 = re.compile('abc', re.IGNORECASE)