added a test for trac issue 658