mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Issue #21526: Tkinter now supports new boolean type in Tcl 8.5.
This commit is contained in:
parent
f41f8f9974
commit
f7de3dd02d
3 changed files with 51 additions and 15 deletions
|
@ -378,6 +378,21 @@ class TclTest(unittest.TestCase):
|
|||
if tcl_version >= (8, 5):
|
||||
check('2**64', True)
|
||||
|
||||
def test_booleans(self):
|
||||
tcl = self.interp
|
||||
def check(expr, expected):
|
||||
result = tcl.call('expr', expr)
|
||||
self.assertEqual(result, expected)
|
||||
self.assertIsInstance(result, int)
|
||||
check('true', True)
|
||||
check('yes', True)
|
||||
check('on', True)
|
||||
check('false', False)
|
||||
check('no', False)
|
||||
check('off', False)
|
||||
check('1 < 2', True)
|
||||
check('1 > 2', False)
|
||||
|
||||
def test_passing_values(self):
|
||||
def passValue(value):
|
||||
return self.interp.call('set', '_', value)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue