added test for fix to #7840