Regression tests for GH-1057.

Regression tests to show #1057 fails.

The branch is merged into #1051 to show it passes there.

Do not merge alone, only as part of #1051.