mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-20 20:41:13 +08:00
remove repl style comments and use indented blocks instead, #146
This commit is contained in:
@@ -23,12 +23,13 @@ def run_test(source, f_name, lines_to_execute):
|
|||||||
which results are expected. The comment always begins with `#?`. The last
|
which results are expected. The comment always begins with `#?`. The last
|
||||||
row symbolizes the cursor.
|
row symbolizes the cursor.
|
||||||
|
|
||||||
For example:
|
For example::
|
||||||
>>> #? ['ab']
|
|
||||||
>>> ab = 3; a
|
|
||||||
|
|
||||||
>>> #? int()
|
#? ['ab']
|
||||||
>>> ab = 3; ab
|
ab = 3; a
|
||||||
|
|
||||||
|
#? int()
|
||||||
|
ab = 3; ab
|
||||||
"""
|
"""
|
||||||
fails = 0
|
fails = 0
|
||||||
tests = 0
|
tests = 0
|
||||||
|
|||||||
34
test/run.py
34
test/run.py
@@ -70,10 +70,10 @@ def run_completion_test(script, correct, line_nr):
|
|||||||
results are expected. The comment always begins with `#?`. The last row
|
results are expected. The comment always begins with `#?`. The last row
|
||||||
symbolizes the cursor.
|
symbolizes the cursor.
|
||||||
|
|
||||||
For example:
|
For example::
|
||||||
|
|
||||||
>>> #? ['real']
|
#? ['real']
|
||||||
>>> a = 3; a.rea
|
a = 3; a.rea
|
||||||
|
|
||||||
Because it follows ``a.rea`` and a is an ``int``, which has a ``real``
|
Because it follows ``a.rea`` and a is an ``int``, which has a ``real``
|
||||||
property.
|
property.
|
||||||
@@ -94,10 +94,10 @@ def run_completion_test(script, correct, line_nr):
|
|||||||
def run_definition_test(script, should_str, line_nr):
|
def run_definition_test(script, should_str, line_nr):
|
||||||
"""
|
"""
|
||||||
Definition tests use the same symbols like completion tests. This is
|
Definition tests use the same symbols like completion tests. This is
|
||||||
possible because the completion tests are defined with a list.
|
possible because the completion tests are defined with a list::
|
||||||
|
|
||||||
>>> #? int()
|
#? int()
|
||||||
>>> ab = 3; ab
|
ab = 3; ab
|
||||||
|
|
||||||
Returns 1 for fail and 0 for success.
|
Returns 1 for fail and 0 for success.
|
||||||
"""
|
"""
|
||||||
@@ -112,17 +112,17 @@ def run_definition_test(script, should_str, line_nr):
|
|||||||
|
|
||||||
def run_goto_test(script, correct, line_nr):
|
def run_goto_test(script, correct, line_nr):
|
||||||
"""
|
"""
|
||||||
Tests look like this:
|
Tests look like this::
|
||||||
|
|
||||||
>>> abc = 1
|
abc = 1
|
||||||
>>> #! ['abc=1']
|
#! ['abc=1']
|
||||||
>>> abc
|
abc
|
||||||
|
|
||||||
Additionally it is possible to add a number which describes to position of
|
Additionally it is possible to add a number which describes to position of
|
||||||
the test (otherwise it's just end of line).
|
the test (otherwise it's just end of line)::
|
||||||
|
|
||||||
>>> #! 2 ['abc=1']
|
#! 2 ['abc=1']
|
||||||
>>> abc
|
abc
|
||||||
|
|
||||||
Returns 1 for fail and 0 for success.
|
Returns 1 for fail and 0 for success.
|
||||||
"""
|
"""
|
||||||
@@ -137,11 +137,11 @@ def run_goto_test(script, correct, line_nr):
|
|||||||
|
|
||||||
def run_related_name_test(script, correct, line_nr):
|
def run_related_name_test(script, correct, line_nr):
|
||||||
"""
|
"""
|
||||||
Tests look like this:
|
Tests look like this::
|
||||||
|
|
||||||
>>> abc = 1
|
abc = 1
|
||||||
>>> #< abc@1,0 abc@3,0
|
#< abc@1,0 abc@3,0
|
||||||
>>> abc
|
abc
|
||||||
|
|
||||||
Returns 1 for fail and 0 for success.
|
Returns 1 for fail and 0 for success.
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user