[py-svn] r38362 - in py/trunk/py/apigen/source: . testing
guido at codespeak.net
guido at codespeak.net
Sat Feb 10 12:06:59 CET 2007
Author: guido
Date: Sat Feb 10 12:06:58 2007
New Revision: 38362
Modified:
py/trunk/py/apigen/source/color.py
py/trunk/py/apigen/source/testing/test_color.py
Log:
Fixed stupidity in the last checkin: only matching multi-line strings using
slashes if the slash is actually at the end of the line... :(
Modified: py/trunk/py/apigen/source/color.py
==============================================================================
--- py/trunk/py/apigen/source/color.py (original)
+++ py/trunk/py/apigen/source/color.py Sat Feb 10 12:06:58 2007
@@ -71,7 +71,7 @@
j = schema.linejoin
for d in schema.string + schema.multiline_string:
self._re_strings_multiline.append(
- (re.compile('%s.*%s' % (d, j)),
+ (re.compile('%s.*%s$' % (d, j)),
re.compile('.*?%s' % (d,))))
for d in schema.multiline_string:
self._re_strings_multiline.append((re.compile('%s.*' % (d,), re.S),
Modified: py/trunk/py/apigen/source/testing/test_color.py
==============================================================================
--- py/trunk/py/apigen/source/testing/test_color.py (original)
+++ py/trunk/py/apigen/source/testing/test_color.py Sat Feb 10 12:06:58 2007
@@ -83,6 +83,8 @@
assert res == [Token("bar'", type='string')]
res = list(t.tokenize("bar"))
assert res == [Token('bar', type='word')]
+ res = list(t.tokenize('"foo\\bar"'))
+ assert res == [Token('"foo\\bar"', type="string")]
def test_string_following_printable(self):
assert self.tokens('."foo"') == [Token('.', type='unknown'),
More information about the pytest-commit
mailing list