Show More
@@ -10,6 +10,8 b' import string' | |||||
10 | from IPython.core import inputtransformer2 as ipt2 |
|
10 | from IPython.core import inputtransformer2 as ipt2 | |
11 | from IPython.core.inputtransformer2 import make_tokens_by_line |
|
11 | from IPython.core.inputtransformer2 import make_tokens_by_line | |
12 |
|
12 | |||
|
13 | from textwrap import dedent | |||
|
14 | ||||
13 | MULTILINE_MAGIC = ("""\ |
|
15 | MULTILINE_MAGIC = ("""\ | |
14 | a = f() |
|
16 | a = f() | |
15 | %foo \\ |
|
17 | %foo \\ | |
@@ -208,6 +210,14 b' def test_check_complete():' | |||||
208 | nt.assert_equal(cc("a \\ "), ('invalid', None)) # Nothing allowed after backslash |
|
210 | nt.assert_equal(cc("a \\ "), ('invalid', None)) # Nothing allowed after backslash | |
209 | nt.assert_equal(cc("1\\\n+2"), ('complete', None)) |
|
211 | nt.assert_equal(cc("1\\\n+2"), ('complete', None)) | |
210 |
|
212 | |||
|
213 | example = dedent(""" | |||
|
214 | if True: | |||
|
215 | a=1""" ) | |||
|
216 | ||||
|
217 | nt.assert_equal(cc(example), ('incomplete', 4)) | |||
|
218 | nt.assert_equal(cc(example+'\n'), ('complete', None)) | |||
|
219 | nt.assert_equal(cc(example+'\n '), ('complete', None)) | |||
|
220 | ||||
211 | # no need to loop on all the letters/numbers. |
|
221 | # no need to loop on all the letters/numbers. | |
212 | short = '12abAB'+string.printable[62:] |
|
222 | short = '12abAB'+string.printable[62:] | |
213 | for c in short: |
|
223 | for c in short: |
General Comments 0
You need to be logged in to leave comments.
Login now