Skip to content

Commit 3891e38

Browse files
kinto0facebook-github-bot
authored andcommitted
integration test for relative path go-to definition
Summary: I noticed these broke in a change I'm making. before the change, I'd like to show that they still work. Reviewed By: SamChou19815 Differential Revision: D75472820 fbshipit-source-id: 3eb84cce7d40b3d80aed47b74978270ae0f6ca80
1 parent cd539d5 commit 3891e38

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

pyrefly/lib/test/lsp/lsp_interaction.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,21 @@ fn test_go_to_def_no_folder_capability() {
177177
test_go_to_def_basic(&root, None);
178178
}
179179

180+
#[test]
181+
fn test_go_to_def_relative_path() {
182+
test_go_to_def(
183+
&get_test_files_root(),
184+
None,
185+
"foo_relative.py",
186+
vec![
187+
(5, 14, "bar.py".to_owned(), 0, 0, 0, 0),
188+
(6, 17, "bar.py".to_owned(), 6, 6, 6, 9),
189+
(8, 9, "bar.py".to_owned(), 7, 4, 7, 7),
190+
(9, 7, "bar.py".to_owned(), 6, 6, 6, 9),
191+
],
192+
);
193+
}
194+
180195
#[test]
181196
fn definition_in_builtins_enabled() {
182197
let root = get_test_files_root();
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) Meta Platforms, Inc. and affiliates.
2+
#
3+
# This source code is licensed under the MIT license found in the
4+
# LICENSE file in the root directory of this source tree.
5+
6+
from . import bar
7+
from .bar import Bar
8+
9+
Bar().foo
10+
bar.Bar().foo

0 commit comments

Comments
 (0)