mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
added type tests
This commit is contained in:
@@ -1,12 +1,30 @@
|
|||||||
|
# -----------------
|
||||||
|
# non array
|
||||||
|
# -----------------
|
||||||
|
|
||||||
|
#? ['imag']
|
||||||
|
int.imag
|
||||||
|
|
||||||
|
#? []
|
||||||
|
int.is_integer
|
||||||
|
|
||||||
|
#? ['is_integer']
|
||||||
|
float.is_int
|
||||||
|
|
||||||
|
#? ['is_integer']
|
||||||
|
1.0.is_integer
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
# lists
|
# lists
|
||||||
# -----------------
|
# -----------------
|
||||||
arr = []
|
arr = []
|
||||||
#? ['append']
|
#? ['append']
|
||||||
arr().app
|
arr.app
|
||||||
|
|
||||||
#? ['append']
|
#? ['append']
|
||||||
list().app
|
list().app
|
||||||
|
#? ['append']
|
||||||
|
[].append
|
||||||
|
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
@@ -20,6 +38,8 @@ dic.c
|
|||||||
dic2 = dict(a=1, b=2)
|
dic2 = dict(a=1, b=2)
|
||||||
#? ['pop', 'popitem']
|
#? ['pop', 'popitem']
|
||||||
dic2.p
|
dic2.p
|
||||||
|
#? ['popitem']
|
||||||
|
{}.popitem
|
||||||
|
|
||||||
|
|
||||||
# -----------------
|
# -----------------
|
||||||
@@ -46,3 +66,5 @@ tup.c
|
|||||||
tup2 = tuple()
|
tup2 = tuple()
|
||||||
#? ['index']
|
#? ['index']
|
||||||
tup2.i
|
tup2.i
|
||||||
|
#? ['index']
|
||||||
|
().i
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ def completion_test(source):
|
|||||||
comp_str = str(sorted([str(c) for c in completions]))
|
comp_str = str(sorted([str(c) for c in completions]))
|
||||||
if comp_str != correct:
|
if comp_str != correct:
|
||||||
print 'Solution not correct, received %s, wanted %s' % \
|
print 'Solution not correct, received %s, wanted %s' % \
|
||||||
(correct, comp_str)
|
(comp_str, correct)
|
||||||
fails += 1
|
fails += 1
|
||||||
correct = None
|
correct = None
|
||||||
tests += 1
|
tests += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user