import pymorph
import numpy as np
def test_patspec():
    f = np.array([
        [0,0,0,0,0,0,0,0],
        [0,0,1,1,1,1,0,0],
        [0,1,0,1,1,1,0,0],
        [0,0,1,1,1,1,0,0],
        [1,1,0,0,0,0,0,0]], bool)
    assert pymorph.patspec(f).sum() == (f > 0).sum()


@@ -262,8 +262,175 @@
 .sum()%0A%0A
+def test_linear_h():%0A    f = np.arange(9).reshape((3,3)) %25 3 %3E 0%0A    # This crashed in 0.95%0A    # reported by Alexandre Harano%0A    g = pymorph.patspec(f, 'linear-h')%0A%0A

Test case for newly reported bug