-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure tests pass both on ARTIQ Python and CPython.
In some cases (the `is` operator and wraparound arithmetics) the tests will only pass on ARTIQ Python. These are conditionally commented out.
whitequark
committed
Jul 23, 2015
1 parent
65121b4
commit 20f5f82
Showing
16 changed files
with
34 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# RUN: %python -m artiq.compiler.testbench.jit %s | ||
# RUN: %python %s | ||
|
||
r = range(10) | ||
assert r.start == 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
# RUN: %python -m artiq.compiler.testbench.jit %s | ||
# RUN: %python %s | ||
|
||
assert bool() is False | ||
# bool(x) is tested in bool.py | ||
|
||
assert int() is 0 | ||
assert int(1.0) is 1 | ||
assert int(1, width=64) << 40 is 1099511627776 | ||
#ARTIQ#assert int(1, width=64) << 40 is 1099511627776 | ||
|
||
assert float() is 0.0 | ||
assert float(1) is 1.0 | ||
#ARTIQ#assert float() is 0.0 | ||
#ARTIQ#assert float(1) is 1.0 | ||
|
||
x = list() | ||
if False: x = [1] | ||
assert x == [] | ||
|
||
assert range(10) is range(0, 10, 1) | ||
assert range(1, 10) is range(1, 10, 1) | ||
#ARTIQ#assert range(10) is range(0, 10, 1) | ||
#ARTIQ#assert range(1, 10) is range(1, 10, 1) | ||
|
||
assert len([1, 2, 3]) is 3 | ||
assert len(range(10)) is 10 | ||
assert len(range(0, 10, 2)) is 5 | ||
|
||
assert round(1.4) is 1 and round(1.6) is 2 | ||
#ARTIQ#assert round(1.4) is 1 and round(1.6) is 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# RUN: %python -m artiq.compiler.testbench.jit %s | ||
# RUN: %python %s | ||
|
||
count = 0 | ||
for x in range(10): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# RUN: %python -m artiq.compiler.testbench.jit %s | ||
# RUN: %python %s | ||
|
||
def fib(x): | ||
if x == 1: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# RUN: %python -m artiq.compiler.testbench.jit %s | ||
# RUN: %python %s | ||
|
||
if True: | ||
assert True | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# RUN: %python -m artiq.compiler.testbench.jit %s | ||
# RUN: %python %s | ||
|
||
[x, y] = [1, 2] | ||
assert (x, y) == (1, 2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# RUN: %python -m artiq.compiler.testbench.jit %s | ||
# RUN: %python %s | ||
|
||
x = 1 | ||
assert x == 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# RUN: %python -m artiq.compiler.testbench.jit %s | ||
# RUN: %python %s | ||
|
||
lst = list(range(10)) | ||
assert lst[0] == 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# RUN: %python -m artiq.compiler.testbench.jit %s | ||
# RUN: %python %s | ||
|
||
x, y = 2, 1 | ||
x, y = y, x | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# RUN: %python -m artiq.compiler.testbench.jit %s | ||
# RUN: %python %s | ||
|
||
cond, count = True, 0 | ||
while cond: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters