tests added / error catch

This commit is contained in:
David Halter
2012-04-25 09:48:31 +02:00
parent 1ea2954c0e
commit 3780e44603
6 changed files with 36 additions and 9 deletions

View File

@@ -96,3 +96,19 @@ u1.real
(u1).real
#? []
u1.upper
# -----------------
# should fail
# -----------------
(f, g) = (1,)
#? ['imag']
f.imag
#? []
g.upper
(f1, g1) = 1
#? []
f1.
#? []
g1.

View File

@@ -10,6 +10,9 @@ class TestClass(object):
#? ['var_class', 'var_inst', 'var_local']
self.var_
def ret(self, a1):
return a1
inst = TestClass(1)
#? ['var_class', 'var_inst', 'var_local']
@@ -17,3 +20,6 @@ inst.var
#? ['var_class']
TestClass.var_class
#? ['real']
TestClass().ret(1).real

View File

@@ -35,7 +35,7 @@ def completion_test(source):
completions = functions.complete(source, line_nr, 999,
completion_test_dir)
except:
print 'test: %s' % line
print 'test @%s: %s' % (line_nr, line)
print traceback.format_exc()
fails += 1
else:
@@ -43,7 +43,7 @@ def completion_test(source):
# TODO remove set! duplicates should not be normal
comp_str = str(sorted(set([str(c) for c in completions])))
if comp_str != correct:
print 'Solution on %s not correct, received %s, wanted %s'\
print 'Solution on @%s not correct, received %s, wanted %s'\
% (line_nr, comp_str, correct)
#print [(c.name, c.name.parent) for c in completions]
fails += 1