TST: added test from https://github.com/scipy/scipy/issues/1779