Import for tests from test.check patch

Am about to make a test for a bug I found.
Failing test for for
Fix destructuring bug