Add a unit test for constraint