Implement the test from #3210, which was not merged yet, because the PR was abandoned in favor or #3234.