[Python-checkins] cpython (merge 3.2 -> 3.3): Issue #17118: Add new tests for testing Python-Tcl interaction.
serhiy.storchaka
python-checkins at python.org
Thu Feb 7 14:42:52 CET 2013
http://hg.python.org/cpython/rev/452344620c97
changeset: 82048:452344620c97
branch: 3.3
parent: 82044:c2ed79fbb9c6
parent: 82047:148e6ebfe854
user: Serhiy Storchaka <storchaka at gmail.com>
date: Thu Feb 07 15:40:26 2013 +0200
summary:
Issue #17118: Add new tests for testing Python-Tcl interaction.
files:
Lib/test/test_tcl.py | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -151,6 +151,26 @@
# exit code must be zero
self.assertEqual(f.close(), None)
+ def test_passing_values(self):
+ def passValue(value):
+ return self.interp.call('set', '_', value)
+
+ self.assertEqual(passValue(True), True)
+ self.assertEqual(passValue(False), False)
+ self.assertEqual(passValue('string'), 'string')
+ self.assertEqual(passValue('string\u20ac'), 'string\u20ac')
+ for i in (0, 1, -1, 2**31-1, -2**31):
+ self.assertEqual(passValue(i), i)
+ for f in (0.0, 1.0, -1.0, 1/3,
+ sys.float_info.min, sys.float_info.max,
+ -sys.float_info.min, -sys.float_info.max):
+ self.assertEqual(passValue(f), f)
+ for f in float('nan'), float('inf'), -float('inf'):
+ if f != f: # NaN
+ self.assertNotEqual(passValue(f), f)
+ else:
+ self.assertEqual(passValue(f), f)
+ self.assertEqual(passValue((1, '2', (3.4,))), (1, '2', (3.4,)))
def test_main():
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list