fill PyConsoleIndentTest with new tests and improve old

(cherry picked from commit c16b6d7b2a8ada5b8d2a8cd882dc64593dccf00e)
This commit is contained in:
Alexander Marchuk
2014-05-07 12:01:31 +02:00
committed by Dmitry Trofimov
parent 2aa7076226
commit 9b9707909c
21 changed files with 144 additions and 6 deletions
+15
View File
@@ -0,0 +1,15 @@
x = '''Multiline starts;
next line with indent;
next line with indent;
multiline ends'''
x = '''Multiline starts;
first
second
third
fourth
fifth
multiline ends'''
x = '''Multiline starts;
#line
#line
multiline ends'''
+17
View File
@@ -0,0 +1,17 @@
x = '''Multiline starts;
next line with indent;
next line with indent;
multiline ends'''
x = '''Multiline starts;
first
second
third
fourth
fifth
multiline ends'''
x = '''Multiline starts;
#line
#line
multiline ends'''
@@ -0,0 +1,4 @@
print('first',#comment
'second', #comment
#inline comment
'third')
+4
View File
@@ -0,0 +1,4 @@
print('first',#comment
'second', #comment
#inline comment
'third')
@@ -0,0 +1,3 @@
def foo():
print(
'12345')
+3
View File
@@ -0,0 +1,3 @@
def foo():
print(
'12345')
@@ -0,0 +1,3 @@
def foo():
return [i**2 for i in
range(1,100,1)]
+3
View File
@@ -0,0 +1,3 @@
def foo():
return [i**2 for i in
range(1,100,1)]
@@ -0,0 +1,5 @@
print 'One, two. How are you?\
Three, four. Who\'s at the door?\
Five, six. My name is Fix.\
Seven, eght. Sorry, I\'m late.\
Nine, ten. Say it again.'
+5
View File
@@ -0,0 +1,5 @@
print 'One, two. How are you?\
Three, four. Who\'s at the door?\
Five, six. My name is Fix.\
Seven, eght. Sorry, I\'m late.\
Nine, ten. Say it again.'
@@ -0,0 +1,3 @@
def foo():
print '4'
print '8'
+3
View File
@@ -0,0 +1,3 @@
def foo():
print '4'
print '8'
@@ -0,0 +1,5 @@
print 'print'
def foo():
print 'foo'
def bar():
print 'bar'
+7
View File
@@ -0,0 +1,7 @@
print 'print'
def foo():
print 'foo'
def bar():
print 'bar'
+2 -2
View File
@@ -1,4 +1,4 @@
for x in range(1, 10):
print x
print 1
print 2
print 1
print 2
+4 -4
View File
@@ -1,5 +1,5 @@
print 1
for j in range(0, 2):
for i in range(1, 10):
print i
print '!'
for j in range(0, 2):
for i in range(1, 10):
print i
print '!'
+4
View File
@@ -0,0 +1,4 @@
def foo():
print 'foo'
#comment with indent
print 'bar'
+4
View File
@@ -0,0 +1,4 @@
def foo():
print 'foo'
#comment with indent
print 'bar'
+7
View File
@@ -0,0 +1,7 @@
class foo:
"""
Some docstring here.
Another string.
"""
def bar(self):
print "hello"
+7
View File
@@ -0,0 +1,7 @@
class foo:
"""
Some docstring here.
Another string.
"""
def bar(self):
print "hello"
@@ -55,6 +55,42 @@ public class PyConsoleIndentTest extends UsefulTestCase {
doTest(2);
}
public void testIndent8() {
doTest();
}
public void testIndent9() {
doTest();
}
public void testIndent10() {
doTest();
}
public void testIndent11() {
doTest();
}
public void testIndent12() {
doTest();
}
public void testIndent13() {
doTest();
}
public void testIndent14() {
doTest();
}
public void testIndent15() {
doTest();
}
public void testIndent16() {
doTest();
}
private void doTest() {
doTest(0);
}