summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-04-02 22:39:08 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-04-02 22:39:08 (GMT)
commitd6030acd7f974fc8595b514032e1801e68fec300 (patch)
tree5d288d34c24561f4a2f8eea02f8236d59a4b748e /Lib
parent4bbcb64d5d6560d8adca119f153779d0d18e0482 (diff)
downloadcpython-d6030acd7f974fc8595b514032e1801e68fec300.zip
cpython-d6030acd7f974fc8595b514032e1801e68fec300.tar.gz
cpython-d6030acd7f974fc8595b514032e1801e68fec300.tar.bz2
Array module's buffer interface can now handle empty arrays.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_re.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index a885180..f15ce09 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -604,6 +604,13 @@ class ReTests(unittest.TestCase):
self.assertEqual(iter.next().span(), (4, 4))
self.assertRaises(StopIteration, iter.next)
+ def test_empty_array(self):
+ # SF buf 1647541
+ import array
+ for typecode in 'cbBuhHiIlLfd':
+ a = array.array(typecode)
+ self.assertEqual(re.compile("bla").match(a), None)
+ self.assertEqual(re.compile("").match(a).groups(), ())
def run_re_tests():
from test.re_tests import benchmarks, tests, SUCCEED, FAIL, SYNTAX_ERROR