Add automated tests for main-class regression.