Prevent double initialization in codegen tests, fix ScriptGenTest#testDependentScripts
Add an assertion to prevent duplicate initialization of CodegenTestFiles instance in CodegenTestCase, which was happening in ScriptGenTest with multiple invocation of loadFile()
This commit is contained in:
@@ -252,6 +252,7 @@ public abstract class CodegenTestCase extends KtUsefulTestCase {
|
||||
try {
|
||||
File file = new File(fullPath);
|
||||
String content = FileUtil.loadFile(file, Charsets.UTF_8.name(), true);
|
||||
assert myFiles == null : "Should not initialize myFiles twice";
|
||||
myFiles = CodegenTestFiles.create(file.getName(), content, myEnvironment.getProject());
|
||||
return content;
|
||||
} catch (IOException e) {
|
||||
|
||||
Reference in New Issue
Block a user