Skip to content

Commit 90ecc00

Browse files
Skip expr* tests for large integers for Tcl <8.5.
The '**' operator is available only since 8.5 and in any case such large integers are not supported on Tcl <8.5.
1 parent f581411 commit 90ecc00

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Lib/test/test_tcl.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ def check(expr, expected):
215215
self.assertRaises(TclError, tcl.exprstring, 'spam')
216216
check('', '0')
217217
check('8.2 + 6', '14.2')
218-
check('2**64', str(2**64))
219218
check('3.1 + $a', '6.1')
220219
check('2 + "$a.$b"', '5.6')
221220
check('4*[llength "6 2"]', '8')
@@ -233,6 +232,8 @@ def check(expr, expected):
233232
check('"a\xc2\xbd\xe2\x82\xac"', 'a\xc2\xbd\xe2\x82\xac')
234233
check(r'"a\xbd\u20ac"', 'a\xc2\xbd\xe2\x82\xac')
235234
check(r'"a\0b"', 'a\xc0\x80b')
235+
if tcl_version >= (8, 5):
236+
check('2**64', str(2**64))
236237

237238
def test_exprdouble(self):
238239
tcl = self.interp
@@ -248,7 +249,6 @@ def check(expr, expected):
248249
self.assertRaises(TclError, tcl.exprdouble, 'spam')
249250
check('', 0.0)
250251
check('8.2 + 6', 14.2)
251-
check('2**64', float(2**64))
252252
check('3.1 + $a', 6.1)
253253
check('2 + "$a.$b"', 5.6)
254254
check('4*[llength "6 2"]', 8.0)
@@ -263,6 +263,8 @@ def check(expr, expected):
263263
check('[string length "a\xc2\xbd\xe2\x82\xac"]', 3.0)
264264
check(r'[string length "a\xbd\u20ac"]', 3.0)
265265
self.assertRaises(TclError, tcl.exprdouble, '"abc"')
266+
if tcl_version >= (8, 5):
267+
check('2**64', float(2**64))
266268

267269
def test_exprlong(self):
268270
tcl = self.interp
@@ -278,7 +280,6 @@ def check(expr, expected):
278280
self.assertRaises(TclError, tcl.exprlong, 'spam')
279281
check('', 0)
280282
check('8.2 + 6', 14)
281-
self.assertRaises(TclError, tcl.exprlong, '2**64')
282283
check('3.1 + $a', 6)
283284
check('2 + "$a.$b"', 5)
284285
check('4*[llength "6 2"]', 8)
@@ -293,6 +294,8 @@ def check(expr, expected):
293294
check('[string length "a\xc2\xbd\xe2\x82\xac"]', 3)
294295
check(r'[string length "a\xbd\u20ac"]', 3)
295296
self.assertRaises(TclError, tcl.exprlong, '"abc"')
297+
if tcl_version >= (8, 5):
298+
self.assertRaises(TclError, tcl.exprlong, '2**64')
296299

297300
def test_exprboolean(self):
298301
tcl = self.interp
@@ -317,7 +320,6 @@ def check(expr, expected):
317320
check('"%s"' % value, True)
318321
check('{%s}' % value, True)
319322
check('8.2 + 6', True)
320-
check('2**64', True)
321323
check('3.1 + $a', True)
322324
check('2 + "$a.$b"', True)
323325
check('4*[llength "6 2"]', True)
@@ -332,6 +334,8 @@ def check(expr, expected):
332334
check('[string length "a\xc2\xbd\xe2\x82\xac"]', True)
333335
check(r'[string length "a\xbd\u20ac"]', True)
334336
self.assertRaises(TclError, tcl.exprboolean, '"abc"')
337+
if tcl_version >= (8, 5):
338+
check('2**64', True)
335339

336340
def test_passing_values(self):
337341
def passValue(value):

0 commit comments

Comments
 (0)