Re-add tests from r179291 which were accidentally removed by r181177.