diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-06-19 23:08:47 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-06-19 23:08:47 +0100 |
| commit | b638bb3c6cee3b7d802b357ccc4ffaa87350eb9b (patch) | |
| tree | 3ce19ab274b33030336df9905f7b4354fb97fc6a /src/test/java/org | |
| parent | fa954fce216e5c9ff5c8fff5a4e7cd9b2f66fda1 (diff) | |
Make relative imports relative to parent namespace
Diffstat (limited to 'src/test/java/org')
| -rw-r--r-- | src/test/java/org/zwobble/hobgoblin/compiler/typechecker/NamespaceNameResolutionTests.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/NamespaceNameResolutionTests.java b/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/NamespaceNameResolutionTests.java index da0eb90..0ae6352 100644 --- a/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/NamespaceNameResolutionTests.java +++ b/src/test/java/org/zwobble/hobgoblin/compiler/typechecker/NamespaceNameResolutionTests.java @@ -29,8 +29,8 @@ public class NamespaceNameResolutionTests { } @Test - public void whenAncestorDepthIsZeroThenImportedNamespaceIsJoinedToCurrentNamespace() { - var current = NamespaceName.of("a", "b"); + public void whenAncestorDepthIsZeroThenImportedNamespaceIsJoinedToParentNamespace() { + var current = NamespaceName.of("a", "b", "c"); var importedAncestorDepth = Optional.of(0); var importedNamespaceName = NamespaceName.of("x", "y"); @@ -45,8 +45,8 @@ public class NamespaceNameResolutionTests { } @Test - public void whenAncestorDepthIsGreaterThanZeroThenThatManyPartsAreStrippedOffCurrentNamespaceBeforeJoining() { - var current = NamespaceName.of("a", "b", "c"); + public void whenAncestorDepthIsGreaterThanZeroThenThatManyPartsAreStrippedOffParentNamespaceBeforeJoining() { + var current = NamespaceName.of("a", "b", "c", "d"); var importedAncestorDepth = Optional.of(2); var importedNamespaceName = NamespaceName.of("x", "y"); @@ -61,9 +61,9 @@ public class NamespaceNameResolutionTests { } @Test - public void whenAncestorDepthIsGreaterThanPartsThenErrorIsThrown() { + public void whenAncestorDepthIsGreaterThanAncestorPartsThenErrorIsThrown() { var current = NamespaceName.of("a", "b", "c"); - var importedAncestorDepth = Optional.of(4); + var importedAncestorDepth = Optional.of(3); var importedNamespaceName = NamespaceName.of("x", "y"); assertThrows(RootNamespaceHasNoParentError.class, () -> resolveNamespaceName( |
