Skip to content

Commit

Permalink
Add tests to address #85.
Browse files Browse the repository at this point in the history
  • Loading branch information
nsbgn committed Mar 13, 2022
1 parent 14bb6f6 commit c1305b1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,19 @@ def test_unification_of_constraint_options(self):
non_function = TypeSchema(lambda x: {F(A, A)[F(A, x), F(A, x)]} >> x)
self.apply(non_function, result=A)

def test_unification_of_constraint_options3(self):
# See #85
f = TypeSchema(lambda x, y, z: F(x, x) ** z[F(x, A)])
g = TypeSchema(lambda x, y, z: F(x, x) ** z[F(x, x)])
self.apply(f, F(A, A), result=F(A, A))
self.apply(g, F(A, A), result=F(A, A))

def test_unification_of_constraint_options2(self):
# If options in a constraint turn out to come down to the same thing,
# they should unify. Also see #85
f = TypeSchema(lambda x, y, z: F(x, y) ** z[F(x, A), F(y, A)])
self.apply(f, F(A, A), result=F(A, A))

def test_overeager_unification_of_constraint_options(self):
# See issue #17
self.assertEqual(F(A, _) <= F(_, A), True)
Expand Down

0 comments on commit c1305b1

Please sign in to comment.