mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
add test case to fix code example in doc
This commit is contained in:
@@ -759,10 +759,11 @@ class Script(object):
|
|||||||
global_var = 3
|
global_var = 3
|
||||||
|
|
||||||
def bar(foo):
|
def bar(foo):
|
||||||
return foo + 1 + global_var
|
return int(foo + 1 + global_var)
|
||||||
|
|
||||||
def x(foo):
|
def x():
|
||||||
x = int(bar(foo))
|
foo = 3.1
|
||||||
|
x = bar(foo)
|
||||||
|
|
||||||
:param new_name: The expression under the cursor will be replaced with
|
:param new_name: The expression under the cursor will be replaced with
|
||||||
a function with this name.
|
a function with this name.
|
||||||
|
|||||||
@@ -1,3 +1,19 @@
|
|||||||
|
# -------------------------------------------------- in-module-0
|
||||||
|
global_var = 3
|
||||||
|
def x():
|
||||||
|
foo = 3.1
|
||||||
|
#? 11 text {'new_name': 'bar'}
|
||||||
|
x = int(foo + 1 + global_var)
|
||||||
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
global_var = 3
|
||||||
|
def bar(foo):
|
||||||
|
return int(foo + 1 + global_var)
|
||||||
|
|
||||||
|
|
||||||
|
def x():
|
||||||
|
foo = 3.1
|
||||||
|
#? 11 text {'new_name': 'bar'}
|
||||||
|
x = bar(foo)
|
||||||
# -------------------------------------------------- in-module-1
|
# -------------------------------------------------- in-module-1
|
||||||
glob = 3
|
glob = 3
|
||||||
#? 11 text {'new_name': 'a'}
|
#? 11 text {'new_name': 'a'}
|
||||||
|
|||||||
Reference in New Issue
Block a user