diff options
author | Raymond Hettinger <python@rcn.com> | 2007-04-02 22:54:21 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2007-04-02 22:54:21 (GMT) |
commit | 01a807db2a4b2d39d8e9473e658b908ff58e1058 (patch) | |
tree | 777212f03785c3a13bb9a353f714a468b397e42f /Lib/test/test_re.py | |
parent | e6e660bde384b21ee41a5b9f6dbbd2bc1bb2ae6b (diff) | |
download | cpython-01a807db2a4b2d39d8e9473e658b908ff58e1058.zip cpython-01a807db2a4b2d39d8e9473e658b908ff58e1058.tar.gz cpython-01a807db2a4b2d39d8e9473e658b908ff58e1058.tar.bz2 |
Array module's buffer interface can now handle empty arrays.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r-- | Lib/test/test_re.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index bb56861..b187ea1 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 |