-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Meta.get_qualified_type_name when run as single file (#11401)
`Meta.get_qualified_type_name` correctly returns fully qualified type name when running a single file from a project with `enso --run Proj/src/Main.enso`.
- Loading branch information
Showing
11 changed files
with
700 additions
and
562 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...ime-integration-tests/src/test/java/org/enso/interpreter/test/meta/QualifiedNameTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.enso.interpreter.test.meta; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.hamcrest.Matchers.is; | ||
|
||
import java.io.IOException; | ||
import org.enso.test.utils.ProjectUtils; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.junit.rules.TemporaryFolder; | ||
|
||
public class QualifiedNameTest { | ||
@Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(); | ||
|
||
private static final String mainModSrc = | ||
""" | ||
from Standard.Base import all | ||
type My_Type | ||
Value x | ||
main = | ||
obj = My_Type.Value 42 | ||
Meta.get_qualified_type_name obj | ||
"""; | ||
|
||
@Test | ||
public void qualifiedTypeNameWorks_WhenRunningSingleFile() throws IOException { | ||
var projDir = temporaryFolder.newFolder().toPath(); | ||
ProjectUtils.createProject("Proj", mainModSrc, projDir); | ||
ProjectUtils.testProjectRun( | ||
projDir, | ||
(res) -> { | ||
assertThat(res.asString(), is("local.Proj.Main.My_Type")); | ||
}); | ||
} | ||
} |
Oops, something went wrong.