From 729df9d55ee975be89f18fa90964f19bead60feb Mon Sep 17 00:00:00 2001 From: gbrandl Date: Tue, 31 Oct 2006 23:46:24 +0100 Subject: [svn] Add encoding support. All processing is now done with unicode strings. --- tests/test_examplefiles.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/test_examplefiles.py') diff --git a/tests/test_examplefiles.py b/tests/test_examplefiles.py index 6347ab88..247f986d 100644 --- a/tests/test_examplefiles.py +++ b/tests/test_examplefiles.py @@ -38,11 +38,12 @@ for fn in os.listdir(os.path.join(testdir, 'examplefiles')): def test(self, lx=lx, absfn=absfn): text = file(absfn, 'U').read() text = text.strip('\n') + '\n' - ntext = '' + text = text.decode('latin1') + ntext = [] for type, val in lx.get_tokens(text): - ntext += val + ntext.append(val) self.failIf(type == Error, 'lexer generated error token for '+absfn) - if ntext != text: + if u''.join(ntext) != text: self.fail('round trip failed for '+absfn) setattr(ExampleFileTest, 'test_%i' % lfd, test) -- cgit v1.2.1