diff --git a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/test/BindingsMapResolutionTest.java b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/test/BindingsMapResolutionTest.java index b59d7b0d3c17..9d0d9313eb9b 100644 --- a/engine/runtime-integration-tests/src/test/java/org/enso/compiler/test/BindingsMapResolutionTest.java +++ b/engine/runtime-integration-tests/src/test/java/org/enso/compiler/test/BindingsMapResolutionTest.java @@ -38,6 +38,7 @@ public void resolveSingleName_FromSingleImport() throws IOException { projDir, bindingsMap -> { assertSingleResolvedType(bindingsMap, "My_Vector"); + assertSingleResolvedType(bindingsMap, "local.Proj.My_Vector.My_Vector"); }); } @@ -48,15 +49,6 @@ public void resolveSingleName_FromSingleImportWithFrom() throws IOException { projDir, bindingsMap -> { assertSingleResolvedType(bindingsMap, "My_Vector"); - }); - } - - @Test - public void resolveQualifiedName_FromSingleImport() throws IOException { - var projDir = createProject("import local.Proj.My_Vector.My_Vector"); - testBindingsMap( - projDir, - bindingsMap -> { assertSingleResolvedType(bindingsMap, "local.Proj.My_Vector.My_Vector"); }); } @@ -81,6 +73,7 @@ public void resolveQualifiedName_FromSingleImport_TwoProjects() throws IOExcepti testBindingsMap( projDir, bindingsMap -> { + assertSingleResolvedType(bindingsMap, "My_Vector"); assertSingleResolvedType(bindingsMap, "local.Lib.My_Vector.My_Vector"); }); } @@ -151,19 +144,21 @@ public void resolveExportedType() throws IOException { new SourceModule( QualifiedName.fromString("My_Module"), """ - type My_Type - Cons - """), + type My_Type + Cons + """), new SourceModule( QualifiedName.fromString("Main"), """ - export project.My_Module.My_Type - """)), + import project.My_Module.My_Type + export project.My_Module.My_Type + """)), projDir); testBindingsMap( projDir, bindingsMap -> { assertSingleResolvedType(bindingsMap, "My_Type"); + assertSingleResolvedType(bindingsMap, "local.Proj.My_Module.My_Type"); }); } @@ -177,13 +172,18 @@ public void resolveReexportedType() throws IOException { ProjectUtils.createProject( "Lib", Set.of( - new SourceModule(QualifiedName.fromString("Main"), "export project.My_Module.My_Type"), + new SourceModule( + QualifiedName.fromString("Main"), + """ + import project.My_Module.My_Type + export project.My_Module.My_Type + """), new SourceModule( QualifiedName.fromString("My_Module"), """ - type My_Type - Cons - """)), + type My_Type + Cons + """)), libDir); ProjectUtils.createProject( "Proj", @@ -192,6 +192,7 @@ public void resolveReexportedType() throws IOException { testBindingsMap( projDir, bindingsMap -> { + assertSingleResolvedType(bindingsMap, "My_Type"); assertSingleResolvedType(bindingsMap, "local.Lib.My_Module.My_Type"); }); } @@ -256,14 +257,12 @@ private static void testBindingsMap( } } - // TODO: Extract from ExportedSymbolsTest private static Context createCtx(Path projDir) { return ContextUtils.defaultContextBuilder() .option(RuntimeOptions.PROJECT_ROOT, projDir.toAbsolutePath().toString()) .build(); } - // TODO: Extract private static void compile(Context ctx) { new PolyglotContext(ctx).getTopScope().compile(true); }