Changeset 4329:6cb375acd678 in livinglogic.python.xist

Show
Ignore:
Timestamp:
02/11/11 12:18:15 (9 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

More division tests.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • test/test_ul4.py

    r4328 r4329  
    99## See ll/__init__.py for the license 
    1010 
     11 
     12from __future__ import division 
    1113 
    1214import sys, os, re, datetime, StringIO, json, contextlib, tempfile, collections, shutil 
     
    341343def test_code_floordivvar(): 
    342344    for r in all_renderers: 
    343         yield eq, '2', r(u'<?code x = 5?><?code x //= 2?><?print x?>') 
    344         yield eq, '-3', r(u'<?code x = -5?><?code x //= 2?><?print x?>') 
     345        for x in (5, -5, 5.0, -5.0, 4, -4, 4.0, -4.0): 
     346            for y in (2, -2, 2.0, -2.0): 
     347                yield evaleq, x // y, r(u'<?code x = {}?><?code x //= {}?><?print x?>'.format(x, y)) 
    345348 
    346349 
    347350def test_code_truedivvar(): 
    348351    for r in all_renderers: 
    349         yield eq, '2.5', r(u'<?code x = 5?><?code x /= 2?><?print x?>') 
    350         yield eq, '-2.5', r(u'<?code x = -5?><?code x /= 2?><?print x?>') 
     352        for x in (5, -5, 5.0, -5.0, 4, -4, 4.0, -4.0): 
     353            for y in (2, -2, 2.0, -2.0): 
     354                yield evaleq, x / y, r(u'<?code x = {}?><?code x /= {}?><?print x?>'.format(x, y)) 
    351355 
    352356