Skip to content

Commit

Permalink
Do not rely on string representation
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdrake committed Feb 18, 2015
1 parent ea1b07c commit 28de13a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyeda/boolalg/test/test_bfarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def test_farray():
# expected <= M slice dimensions, got N
assert_raises(ValueError, X.__getitem__, (2, 2))
sel = exprvars('s', 2)
assert str(X[sel]) == "Or(And(~s[0], ~s[1], x[0]), And(s[0], ~s[1], x[1]), And(~s[0], s[1], x[2]), And(s[0], s[1], x[3]))"
assert str(X[:2][sel[0]]) == "Or(And(~s[0], x[0]), And(s[0], x[1]))"
assert X[sel].equivalent(~sel[0] & ~sel[1] & X[0] | sel[0] & ~sel[1] & X[1] | ~sel[0] & sel[1] & X[2] | sel[0] & sel[1] & X[3])
assert X[:2][sel[0]].equivalent(~sel[0] & X[0] | sel[0] & X[1])
# expected clog2(N) bits
assert_raises(ValueError, X.__getitem__, sel[0])
# slice step not supported
Expand Down

0 comments on commit 28de13a

Please sign in to comment.