aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-07-28 19:40:54 -0400
committerGitHub <noreply@github.com>2025-07-28 19:40:54 -0400
commitd1dfb42e168285954cfb037c653b8c33a31191ce (patch)
tree73ec4458aa30611ba571a3dd6ec74080669e7723 /tests
parenta689caf142d46823064ae58e7a1702644de914bc (diff)
parent8aeba058399f3e64bdd6eea027982977db2998e7 (diff)
Merge pull request #795 from BradLewis/fix/using-statements
Correctly resolving using statements with aliases
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin44
1 files changed, 43 insertions, 1 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index 1389550..9a5d20c 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -3878,7 +3878,7 @@ ast_completion_proc_enum_param :: proc(t: ^testing.T) {
@(test)
ast_completion_using_aliased_package :: proc(t: ^testing.T) {
- packages := make([dynamic]test.Package, context.temp_allocator)
+ packages := make([dynamic]test.Package, context.temp_allocator)
append(
&packages,
@@ -3908,6 +3908,48 @@ ast_completion_using_aliased_package :: proc(t: ^testing.T) {
}
@(test)
+ast_completion_using_aliased_package_multiple :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package, context.temp_allocator)
+
+ append(
+ &packages,
+ test.Package {
+ pkg = "foo_pkg",
+ source = `package foo_pkg
+ foo :: proc() {}
+ `,
+ },
+ )
+
+ append(
+ &packages,
+ test.Package {
+ pkg = "bar_pkg",
+ source = `package bar_pkg
+ bar :: proc() {}
+ `,
+ },
+ )
+
+ source := test.Source {
+ main = `package test
+
+ import "foo_pkg"
+ import "bar_pkg"
+ fp :: foo_pkg
+
+ main :: proc() {
+ using fp
+ f{*}
+ }
+ `,
+ packages = packages[:],
+ }
+
+ test.expect_completion_details(t, &source, ".", {"foo_pkg.foo: proc()"})
+}
+
+@(test)
ast_completion_bitset_if_statement_in :: proc(t: ^testing.T) {
source := test.Source {
main = `package test