From 01a807db2a4b2d39d8e9473e658b908ff58e1058 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 2 Apr 2007 22:54:21 +0000 Subject: Array module's buffer interface can now handle empty arrays. --- Lib/test/test_re.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Lib') diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index bb568612fa..b187ea10da 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -601,6 +601,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 -- cgit v1.2.1