diff options
author | gbrandl <devnull@localhost> | 2006-10-31 23:46:24 +0100 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2006-10-31 23:46:24 +0100 |
commit | 729df9d55ee975be89f18fa90964f19bead60feb (patch) | |
tree | 641a0511cbcfa260d1d4e2287f0ede38e50504d8 /tests/test_examplefiles.py | |
parent | 026d59d92a7b574323484fae8a21c9bcc2401517 (diff) | |
download | pygments-729df9d55ee975be89f18fa90964f19bead60feb.tar.gz |
[svn] Add encoding support. All processing is now done with unicode strings.
Diffstat (limited to 'tests/test_examplefiles.py')
-rw-r--r-- | tests/test_examplefiles.py | 7 |
1 files changed, 4 insertions, 3 deletions
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) |