aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDamian Tarnawski <gthetarnav@gmail.com>2024-08-30 14:20:45 +0200
committerDamian Tarnawski <gthetarnav@gmail.com>2024-08-30 14:20:45 +0200
commitc69f4208fd916cf5d81d2d6f48612030a1c459aa (patch)
tree75e1f7e9424619d5a56e22eee4d057c1c12be136 /tests
parentbd60025df3b54c22a8bcb5745b98a30f88162ddd (diff)
Use a new file tag parser
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index ac74117..1f17fcb 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -2,6 +2,7 @@ package tests
import "core:fmt"
import "core:testing"
+import "core:strings"
import test "src:testing"
@@ -1070,6 +1071,44 @@ ast_file_private_completion :: proc(t: ^testing.T) {
}
@(test)
+ast_file_tag_private_completion :: proc(t: ^testing.T) {
+ comments := []string{
+ "// +private",
+ "//+private file",
+ "// +build ignore",
+ }
+
+ for comment in comments {
+
+ b := strings.builder_make(context.temp_allocator)
+
+ strings.write_string(&b, comment)
+ strings.write_string(&b, `
+ package my_package
+
+ my_proc :: proc() -> bool {}
+ `)
+
+ source := test.Source {
+ main = `package main
+ import "my_package"
+ main :: proc() {
+ my_package.{*}
+ }
+ `,
+ packages = {
+ {
+ pkg = "my_package",
+ source = strings.to_string(b),
+ }
+ },
+ }
+
+ test.expect_completion_details(t, &source, ".", {})
+ }
+}
+
+@(test)
ast_non_mutable_variable_struct_completion :: proc(t: ^testing.T) {
packages := make([dynamic]test.Package, context.temp_allocator)