diff options
| author | Damian Tarnawski <gthetarnav@gmail.com> | 2024-08-30 14:20:45 +0200 |
|---|---|---|
| committer | Damian Tarnawski <gthetarnav@gmail.com> | 2024-08-30 14:20:45 +0200 |
| commit | c69f4208fd916cf5d81d2d6f48612030a1c459aa (patch) | |
| tree | 75e1f7e9424619d5a56e22eee4d057c1c12be136 /tests | |
| parent | bd60025df3b54c22a8bcb5745b98a30f88162ddd (diff) | |
Use a new file tag parser
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 39 |
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) |