This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients ezio.melotti, serhiy.storchaka
Date 2013-01-28.14:20:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1359382852.61.0.210728828907.issue16979@psf.upfronthosting.co.za>
In-reply-to
Content
Ezio, is it a good factorization?

    def check(self, coder):
        def checker(input, expect):
            self.assertEqual(coder(input), (expect, len(input)))
        return checker

    def test_escape_decode(self):
        decode = codecs.unicode_escape_decode
        check = self.check(decode)
        check(b"[\\\n]", "[]")
        check(br'[\"]', '["]')
        check(br"[\']", "[']")
        # other 20 checks ...

And same for test_escape_encode and for bytes escape decoder.
History
Date User Action Args
2013-01-28 14:20:52serhiy.storchakasetrecipients: + serhiy.storchaka, ezio.melotti
2013-01-28 14:20:52serhiy.storchakasetmessageid: <1359382852.61.0.210728828907.issue16979@psf.upfronthosting.co.za>
2013-01-28 14:20:52serhiy.storchakalinkissue16979 messages
2013-01-28 14:20:52serhiy.storchakacreate