1
0
forked from VimPlug/jedi

Fix an issue with creatin a diff, fixes #1757

This commit is contained in:
Dave Halter
2022-11-13 17:51:36 +01:00
parent 26f7878d97
commit 0ba48bbb9d
2 changed files with 24 additions and 2 deletions

View File

@@ -70,3 +70,19 @@ def test_diff_without_ending_newline(Script):
-a
+c
''')
def test_diff_path_outside_of_project(Script):
script = Script(
code='foo = 1',
path='/unknown_dir/file.py',
project=jedi.get_default_project()
)
diff = script.rename(line=1, column=0, new_name='bar').get_diff()
assert diff == dedent('''\
--- /unknown_dir/file.py
+++ /unknown_dir/file.py
@@ -1 +1 @@
-foo = 1
+bar = 1
''')