From d4d26842407b478c63d40bb77d83ca7f2dd68de8 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 13 Mar 2000 23:21:48 +0000 Subject: [PATCH] Marc-Andre Lemburg: Add tests for mixed use of char in string. --- Lib/test/test_unicode.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index b994fb2c83f..64b8ff8bd36 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -219,6 +219,19 @@ test('translate', u"abababc", u'bbbc', {ord('a'):None}) test('translate', u"abababc", u'iiic', {ord('a'):None, ord('b'):ord('i')}) test('translate', u"abababc", u'iiix', {ord('a'):None, ord('b'):ord('i'), ord('c'):u'x'}) +# Contains: +print 'Testing Unicode contains method...', +assert ('a' in 'abdb') == 1 +assert ('a' in 'bdab') == 1 +assert ('a' in 'bdaba') == 1 +assert ('a' in 'bdba') == 1 +assert ('a' in u'bdba') == 1 +assert (u'a' in u'bdba') == 1 +assert (u'a' in u'bdb') == 0 +assert (u'a' in 'bdb') == 0 +assert (u'a' in 'bdba') == 1 +print 'done.' + # Formatting: print 'Testing Unicode formatting strings...', assert u"%s, %s" % (u"abc", "abc") == u'abc, abc'