aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Gavin <danielgavin5@hotmail.com>2021-12-13 21:23:30 +0100
committerDaniel Gavin <danielgavin5@hotmail.com>2021-12-13 21:23:30 +0100
commitf4881fddf7e7c003a709a3ed5fd413270d41d261 (patch)
treeab4cf3008856cdebfa032bb833957c607f2735e0 /tests
parentc67ba465cbee1c450f75785905ba5d74d03cb3c8 (diff)
Improved type completion + add constants type, add deprecrated tag.
Diffstat (limited to 'tests')
-rw-r--r--tests/completions_test.odin51
1 files changed, 50 insertions, 1 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin
index ef28802..1ea7efa 100644
--- a/tests/completions_test.odin
+++ b/tests/completions_test.odin
@@ -789,7 +789,6 @@ ast_overload_with_any_int_index_completion :: proc(t: ^testing.T) {
@(test)
ast_package_procedure_completion :: proc(t: ^testing.T) {
-
packages := make([dynamic]test.Package);
append(&packages, test.Package {
@@ -906,6 +905,56 @@ ast_basic_value_binary_completion :: proc(t: ^testing.T) {
test.expect_completion_details(t, &source, "", {"test.xb2: int"});
}
+@(test)
+ast_file_private_completion :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package);
+
+ append(&packages, test.Package {
+ pkg = "my_package",
+ source = `package my_package
+
+ @(private="file") my_proc :: proc() -> bool {
+ }
+ `,
+ });
+
+ source := test.Source {
+ main = `package main
+ import "my_package"
+ main :: proc() {
+ my_package.*
+ }
+ `,
+ packages = packages[:],
+ };
+
+ test.expect_completion_details(t, &source, ".", {});
+}
+
+@(test)
+ast_non_mutable_variable_struct_completion :: proc(t: ^testing.T) {
+ packages := make([dynamic]test.Package);
+
+ append(&packages, test.Package {
+ pkg = "my_package",
+ source = `package my_package
+ My_Struct :: struct { a: int }
+ Im :: My_Struct;
+ `,
+ });
+
+ source := test.Source {
+ main = `package main
+ import "my_package"
+ main :: proc() {
+ my_package.*
+ }
+ `,
+ packages = packages[:],
+ };
+
+ test.expect_completion_details(t, &source, ".", {"my_package.Im: struct"});
+}
/*
Looks like a bug in for each on w.*