[loader] Rename optTest to test and add tests for it