mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
fill PyConsoleIndentTest with new tests and improve old
(cherry picked from commit c16b6d7b2a8ada5b8d2a8cd882dc64593dccf00e)
This commit is contained in:
committed by
Dmitry Trofimov
parent
2aa7076226
commit
9b9707909c
15
python/testData/console/indent10.after.py
Normal file
15
python/testData/console/indent10.after.py
Normal 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
python/testData/console/indent10.py
Normal file
17
python/testData/console/indent10.py
Normal 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'''
|
||||
4
python/testData/console/indent11.after.py
Normal file
4
python/testData/console/indent11.after.py
Normal file
@@ -0,0 +1,4 @@
|
||||
print('first',#comment
|
||||
'second', #comment
|
||||
#inline comment
|
||||
'third')
|
||||
4
python/testData/console/indent11.py
Normal file
4
python/testData/console/indent11.py
Normal file
@@ -0,0 +1,4 @@
|
||||
print('first',#comment
|
||||
'second', #comment
|
||||
#inline comment
|
||||
'third')
|
||||
3
python/testData/console/indent12.after.py
Normal file
3
python/testData/console/indent12.after.py
Normal file
@@ -0,0 +1,3 @@
|
||||
def foo():
|
||||
print(
|
||||
'12345')
|
||||
3
python/testData/console/indent12.py
Normal file
3
python/testData/console/indent12.py
Normal file
@@ -0,0 +1,3 @@
|
||||
def foo():
|
||||
print(
|
||||
'12345')
|
||||
3
python/testData/console/indent13.after.py
Normal file
3
python/testData/console/indent13.after.py
Normal file
@@ -0,0 +1,3 @@
|
||||
def foo():
|
||||
return [i**2 for i in
|
||||
range(1,100,1)]
|
||||
3
python/testData/console/indent13.py
Normal file
3
python/testData/console/indent13.py
Normal file
@@ -0,0 +1,3 @@
|
||||
def foo():
|
||||
return [i**2 for i in
|
||||
range(1,100,1)]
|
||||
5
python/testData/console/indent14.after.py
Normal file
5
python/testData/console/indent14.after.py
Normal 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.'
|
||||
5
python/testData/console/indent14.py
Normal file
5
python/testData/console/indent14.py
Normal 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.'
|
||||
3
python/testData/console/indent15.after.py
Normal file
3
python/testData/console/indent15.after.py
Normal file
@@ -0,0 +1,3 @@
|
||||
def foo():
|
||||
print '4'
|
||||
print '8'
|
||||
3
python/testData/console/indent15.py
Normal file
3
python/testData/console/indent15.py
Normal file
@@ -0,0 +1,3 @@
|
||||
def foo():
|
||||
print '4'
|
||||
print '8'
|
||||
5
python/testData/console/indent16.after.py
Normal file
5
python/testData/console/indent16.after.py
Normal file
@@ -0,0 +1,5 @@
|
||||
print 'print'
|
||||
def foo():
|
||||
print 'foo'
|
||||
def bar():
|
||||
print 'bar'
|
||||
7
python/testData/console/indent16.py
Normal file
7
python/testData/console/indent16.py
Normal file
@@ -0,0 +1,7 @@
|
||||
print 'print'
|
||||
|
||||
def foo():
|
||||
print 'foo'
|
||||
|
||||
def bar():
|
||||
print 'bar'
|
||||
@@ -1,4 +1,4 @@
|
||||
for x in range(1, 10):
|
||||
print x
|
||||
print 1
|
||||
print 2
|
||||
print 1
|
||||
print 2
|
||||
@@ -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
python/testData/console/indent8.after.py
Normal file
4
python/testData/console/indent8.after.py
Normal file
@@ -0,0 +1,4 @@
|
||||
def foo():
|
||||
print 'foo'
|
||||
#comment with indent
|
||||
print 'bar'
|
||||
4
python/testData/console/indent8.py
Normal file
4
python/testData/console/indent8.py
Normal file
@@ -0,0 +1,4 @@
|
||||
def foo():
|
||||
print 'foo'
|
||||
#comment with indent
|
||||
print 'bar'
|
||||
7
python/testData/console/indent9.after.py
Normal file
7
python/testData/console/indent9.after.py
Normal file
@@ -0,0 +1,7 @@
|
||||
class foo:
|
||||
"""
|
||||
Some docstring here.
|
||||
Another string.
|
||||
"""
|
||||
def bar(self):
|
||||
print "hello"
|
||||
7
python/testData/console/indent9.py
Normal file
7
python/testData/console/indent9.py
Normal 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user