aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBradley Lewis <22850972+BradLewis@users.noreply.github.com>2025-12-30 09:11:44 +1100
committerGitHub <noreply@github.com>2025-12-30 09:11:44 +1100
commit16cd61e0f5ad5409f1747c24bdca545423892fdb (patch)
tree5c3cf75d2c3002b4a31a298733fd1a2f0956f11c /tests
parente7b8ab905f842fd1996c6dec4f80ed0f615d5200 (diff)
parentddc4a61653f0dc620bfa565c598f92b840500a9a (diff)
Merge pull request #1238 from BradLewis/fix/completions-bit-set-proc-group
Improve bitset completions with proc groups
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin25
-rw-r--r--tests/hover_test.odin26
2 files changed, 51 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index 6e1eba6..033813b 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -5233,7 +5233,32 @@ ast_completion_proc_arg_default_enum_alias :: proc(t: ^testing.T) {
main :: proc() {
foo(.{*})
}
+ `,
+ }
+ test.expect_completion_docs(t, &source, "", {"A", "B"})
+}
+
+@(test)
+ast_completion_proc_group_bitset :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: enum {
+ A,
+ B,
+ }
+
+ Foos :: bit_set[Foo]
+ foo_one :: proc(i: int, foos: Foos) {}
+ foo_two :: proc(s: string, foos: Foos) {}
+ foo :: proc {
+ foo_one,
+ foo_two,
+ }
+
+ main :: proc() {
+ foo(1, {.{*}})
+ }
`,
}
test.expect_completion_docs(t, &source, "", {"A", "B"})
diff --git a/tests/hover_test.odin b/tests/hover_test.odin
index 6f8cecf..8c39b0f 100644
--- a/tests/hover_test.odin
+++ b/tests/hover_test.odin
@@ -5960,6 +5960,32 @@ ast_hover_directives_config_info :: proc(t: ^testing.T) {
}
test.expect_hover(t, &source, "#config(<identifier>, default)\n\nChecks if an identifier is defined through the command line, or gives a default value instead.\n\nValues can be set with the `-define:NAME=VALUE` command line flag.")
}
+
+@(test)
+ast_hover_proc_group_bitset :: proc(t: ^testing.T) {
+ source := test.Source {
+ main = `package test
+ Foo :: enum {
+ A,
+ B,
+ }
+
+ Foos :: bit_set[Foo]
+
+ foo_one :: proc(i: int, foos: Foos) {}
+ foo_two :: proc(s: string, foos: Foos) {}
+ foo :: proc {
+ foo_one,
+ foo_two,
+ }
+
+ main :: proc() {
+ foo(1, {.A{*}})
+ }
+ `,
+ }
+ test.expect_hover(t, &source, "test.Foo: .A")
+}
/*
Waiting for odin fix