diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-09-23 20:20:07 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-09-23 20:20:07 (GMT) |
commit | 369606df2f9235e8e9bce1feabf1ac48c889f8d5 (patch) | |
tree | 14947a537f0f6f04f94f9673398d3f1d7a6b024a /Lib/test | |
parent | 587b30571d8dff63f602ac303659988d7c2ddea3 (diff) | |
download | cpython-369606df2f9235e8e9bce1feabf1ac48c889f8d5.zip cpython-369606df2f9235e8e9bce1feabf1ac48c889f8d5.tar.gz cpython-369606df2f9235e8e9bce1feabf1ac48c889f8d5.tar.bz2 |
Issue #19028: Fixed tkinter.Tkapp.merge() for non-string arguments.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_tcl.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py index cf717d8..2cdac2b 100644 --- a/Lib/test/test_tcl.py +++ b/Lib/test/test_tcl.py @@ -254,6 +254,37 @@ class TclTest(unittest.TestCase): for arg, res in testcases: self.assertEqual(split(arg), res, msg=arg) + def test_merge(self): + with support.check_warnings(('merge is deprecated', + DeprecationWarning)): + merge = self.interp.tk.merge + call = self.interp.tk.call + testcases = [ + ((), ''), + (('a',), 'a'), + ((2,), '2'), + (('',), '{}'), + ('{', '\\{'), + (('a', 'b', 'c'), 'a b c'), + ((' ', '\t', '\r', '\n'), '{ } {\t} {\r} {\n}'), + (('a', ' ', 'c'), 'a { } c'), + (('a', '€'), 'a €'), + (('a', '\U000104a2'), 'a \U000104a2'), + (('a', b'\xe2\x82\xac'), 'a €'), + (('a', ('b', 'c')), 'a {b c}'), + (('a', 2), 'a 2'), + (('a', 3.4), 'a 3.4'), + (('a', (2, 3.4)), 'a {2 3.4}'), + ((), ''), + ((call('list', 1, '2', (3.4,)),), '{1 2 3.4}'), + ((call('dict', 'create', 12, '\u20ac', b'\xe2\x82\xac', (3.4,)),), + '{12 € € 3.4}'), + ] + for args, res in testcases: + self.assertEqual(merge(*args), res, msg=args) + self.assertRaises(UnicodeDecodeError, merge, b'\x80') + self.assertRaises(UnicodeEncodeError, merge, '\udc80') + class BigmemTclTest(unittest.TestCase): |