tests from 1060 

@cdeil I went over the old #1060 PR and moved what was still relevant into this PR.