diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2023-06-29 18:20:08 +0200 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2023-06-29 18:20:08 +0200 |
| commit | ae78fc93465e7604c19af3f6a6339a6667cb8cf1 (patch) | |
| tree | bb3965d1ad8ce26109f5d8aeed0564671c9a00ff /tests | |
| parent | f2427a91ba14cb1fc730d42fea8d309a13608325 (diff) | |
Start working on having fake methods.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/completions_test.odin | 33 | ||||
| -rw-r--r-- | tests/hover_test.odin | 2 |
2 files changed, 34 insertions, 1 deletions
diff --git a/tests/completions_test.odin b/tests/completions_test.odin index 15b3386..68efd37 100644 --- a/tests/completions_test.odin +++ b/tests/completions_test.odin @@ -2152,3 +2152,36 @@ ast_completion_struct_with_same_name_in_pkg :: proc(t: ^testing.T) { test.expect_completion_details(t, &source, ".", {"A.lib_a: int"}) } + +@(test) +zzast_completion_method_with_type :: proc(t: ^testing.T) { + packages := make([dynamic]test.Package) + + append( + &packages, + test.Package{ + pkg = "my_package", + source = `package my_package + A :: struct { + lib_a: int, + } + proc_one :: proc(a: ^A) {} + proc_two :: proc(a: A) {} + `, + }, + ) + + source := test.Source { + main = `package test + import "my_package" + main :: proc() { + a: my_package.A + + a.{*} + } + `, + packages = packages[:], + } + + test.expect_completion_details(t, &source, ".", {"ib_a: int"}) +} diff --git a/tests/hover_test.odin b/tests/hover_test.odin index a21ca70..30afc59 100644 --- a/tests/hover_test.odin +++ b/tests/hover_test.odin @@ -158,7 +158,7 @@ ast_hover_same_name_in_selector_and_field :: proc(t: ^testing.T) { } @(test) -zzast_hover_on_sliced_result :: proc(t: ^testing.T) { +ast_hover_on_sliced_result :: proc(t: ^testing.T) { source := test.Source { main = `package test f :: proc() { |