Skip to content

Commit

Permalink
Update pytests.
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyChacal committed Aug 20, 2024
1 parent 6bbe237 commit 9f1c990
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 6 additions & 4 deletions tests/test_xdsl_op_correctness.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,22 @@ def test_u_and_v_conversion():

scffor_ops = list(ops[6].regions[0].blocks[0].ops)

assert len(scffor_ops) == 7
assert len(scffor_ops) == 9

# First
assert isinstance(scffor_ops[0], LoadOp)
assert isinstance(scffor_ops[1], LoadOp)
assert isinstance(scffor_ops[2], ApplyOp)
assert isinstance(scffor_ops[3], StoreOp)
assert isinstance(scffor_ops[4], LoadOp)

# Second
assert isinstance(scffor_ops[4], ApplyOp)
assert isinstance(scffor_ops[5], StoreOp)
assert isinstance(scffor_ops[5], ApplyOp)
assert isinstance(scffor_ops[6], StoreOp)
assert isinstance(scffor_ops[7], LoadOp)

# Yield
assert isinstance(scffor_ops[6], Yield)
assert isinstance(scffor_ops[8], Yield)

assert type(ops[7] == Call)
assert type(ops[8] == StoreOp)
Expand Down
5 changes: 3 additions & 2 deletions tests/test_xdsl_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ def test_create_xdsl_operator():
assert type(ops[6] == For)

scffor_ops = list(ops[6].regions[0].blocks[0].ops)
assert len(scffor_ops) == 4
assert len(scffor_ops) == 5

# First
assert isinstance(scffor_ops[0], LoadOp)
assert isinstance(scffor_ops[1], ApplyOp)
assert isinstance(scffor_ops[2], StoreOp)
assert isinstance(scffor_ops[3], LoadOp)

# Yield
assert isinstance(scffor_ops[3], Yield)
assert isinstance(scffor_ops[4], Yield)

assert type(ops[7] == Call)
assert type(ops[8] == StoreOp)
Expand Down
5 changes: 4 additions & 1 deletion tests/test_xdsl_passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,13 @@ def test_xdsl_III():

scffor_ops = list(ops[6].regions[0].blocks[0].ops)

assert len(scffor_ops) == 5

assert isinstance(scffor_ops[0], LoadOp)
assert isinstance(scffor_ops[1], ApplyOp)
assert isinstance(scffor_ops[2], StoreOp)
assert isinstance(scffor_ops[3], Yield)
assert isinstance(scffor_ops[3], LoadOp)
assert isinstance(scffor_ops[4], Yield)

assert type(ops[7] == Call)
assert type(ops[8] == StoreOp)
Expand Down

0 comments on commit 9f1c990

Please sign in to comment.