aboutsummaryrefslogtreecommitdiff
path: root/tests/completions_test.odin
diff options
context:
space:
mode:
Diffstat (limited to 'tests/completions_test.odin')
-rw-r--r--tests/completions_test.odin28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index 56553c3..bf05f6a 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -5500,3 +5500,31 @@ ast_completion_fake_method_proc_group_single_arg_cursor_position :: proc(t: ^tes
// The proc group 'negate' should have cursor AFTER parentheses since no additional args
test.expect_completion_edit_text(t, &source, ".", "negate", "methods.negate(n)$0")
}
+
+@(test)
+ast_completion_package_docs :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package, context.temp_allocator)
+
+ append(
+ &packages,
+ test.Package {
+ pkg = "my_package",
+ source = `// Package docs
+ package my_package
+ Foo :: struct{}
+ `,
+ },
+ )
+
+ source := test.Source {
+ main = `package test
+ import "my_package"
+ main :: proc() {
+ my_pack{*}
+ }
+ `,
+ packages = packages[:],
+ }
+
+ test.expect_completion_docs(t, &source, "", {"my_package: package\n---\nPackage docs"})
+}