2015-07-22 23:34:52 +08:00
|
|
|
# RUN: %python -m artiq.compiler.testbench.jit %s
|
2015-07-23 13:09:25 +08:00
|
|
|
# RUN: %python %s
|
2015-07-27 09:44:40 +08:00
|
|
|
# REQUIRES: exceptions
|
2015-07-22 23:34:52 +08:00
|
|
|
|
|
|
|
assert bool() is False
|
|
|
|
# bool(x) is tested in bool.py
|
|
|
|
|
|
|
|
assert int() is 0
|
|
|
|
assert int(1.0) is 1
|
2015-07-23 13:09:25 +08:00
|
|
|
#ARTIQ#assert int(1, width=64) << 40 is 1099511627776
|
2015-07-22 23:34:52 +08:00
|
|
|
|
2015-07-23 13:09:25 +08:00
|
|
|
#ARTIQ#assert float() is 0.0
|
|
|
|
#ARTIQ#assert float(1) is 1.0
|
2015-07-22 23:34:52 +08:00
|
|
|
|
|
|
|
x = list()
|
|
|
|
if False: x = [1]
|
|
|
|
assert x == []
|
|
|
|
|
2015-07-23 13:09:25 +08:00
|
|
|
#ARTIQ#assert range(10) is range(0, 10, 1)
|
|
|
|
#ARTIQ#assert range(1, 10) is range(1, 10, 1)
|
2015-07-22 23:34:52 +08:00
|
|
|
|
|
|
|
assert len([1, 2, 3]) is 3
|
|
|
|
assert len(range(10)) is 10
|
|
|
|
assert len(range(0, 10, 2)) is 5
|
|
|
|
|
2015-07-23 13:09:25 +08:00
|
|
|
#ARTIQ#assert round(1.4) is 1 and round(1.6) is 2
|