fill PyConsoleIndentTest with new tests and improve old

(cherry picked from commit c16b6d7b2a8ada5b8d2a8cd882dc64593dccf00e)
This commit is contained in:
Alexander Marchuk
2014-04-23 15:05:48 +04:00
committed by Dmitry Trofimov
parent 2aa7076226
commit 9b9707909c
21 changed files with 144 additions and 6 deletions

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'''

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'''

View File

@@ -0,0 +1,4 @@
print('first',#comment
'second', #comment
#inline comment
'third')

View File

@@ -0,0 +1,4 @@
print('first',#comment
'second', #comment
#inline comment
'third')

View File

@@ -0,0 +1,3 @@
def foo():
print(
'12345')

View File

@@ -0,0 +1,3 @@
def foo():
print(
'12345')

View File

@@ -0,0 +1,3 @@
def foo():
return [i**2 for i in
range(1,100,1)]

View File

@@ -0,0 +1,3 @@
def foo():
return [i**2 for i in
range(1,100,1)]

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.'

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.'

View File

@@ -0,0 +1,3 @@
def foo():
print '4'
print '8'

View File

@@ -0,0 +1,3 @@
def foo():
print '4'
print '8'

View File

@@ -0,0 +1,5 @@
print 'print'
def foo():
print 'foo'
def bar():
print 'bar'

View File

@@ -0,0 +1,7 @@
print 'print'
def foo():
print 'foo'
def bar():
print 'bar'

View File

@@ -1,4 +1,4 @@
for x in range(1, 10):
print x
print 1
print 2
print 1
print 2

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 '!'

View File

@@ -0,0 +1,4 @@
def foo():
print 'foo'
#comment with indent
print 'bar'

View File

@@ -0,0 +1,4 @@
def foo():
print 'foo'
#comment with indent
print 'bar'

View File

@@ -0,0 +1,7 @@
class foo:
"""
Some docstring here.
Another string.
"""
def bar(self):
print "hello"

View File

@@ -0,0 +1,7 @@
class foo:
"""
Some docstring here.
Another string.
"""
def bar(self):
print "hello"

View File

@@ -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);
}