Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Meta.get_qualified_type_name when run as single file #11401

Merged
merged 11 commits into from
Oct 31, 2024
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"));
JaroslavTulach marked this conversation as resolved.
Show resolved Hide resolved
});
}
}
Loading
Loading