Adds a unit test for the bug 697