From 043b67794072c99746677d9431e97b01551c21ff 2018-10-03 17:29:46
From: Matthias Bussonnier <bussonniermatthias@gmail.com>
Date: 2018-10-03 17:29:46
Subject: [PATCH] add tests

---

diff --git a/IPython/core/tests/test_inputtransformer2.py b/IPython/core/tests/test_inputtransformer2.py
index d1ef3df..28e0458 100644
--- a/IPython/core/tests/test_inputtransformer2.py
+++ b/IPython/core/tests/test_inputtransformer2.py
@@ -10,6 +10,8 @@ import string
 from IPython.core import inputtransformer2 as ipt2
 from IPython.core.inputtransformer2 import make_tokens_by_line
 
+from textwrap import dedent
+
 MULTILINE_MAGIC = ("""\
 a = f()
 %foo \\
@@ -208,6 +210,14 @@ def test_check_complete():
     nt.assert_equal(cc("a \\ "), ('invalid', None))  # Nothing allowed after backslash
     nt.assert_equal(cc("1\\\n+2"), ('complete', None))
 
+    example = dedent("""
+        if True:
+            a=1""" )
+
+    nt.assert_equal(cc(example), ('incomplete', 4))
+    nt.assert_equal(cc(example+'\n'), ('complete', None))
+    nt.assert_equal(cc(example+'\n    '), ('complete', None))
+
     # no need to loop on all the letters/numbers.
     short = '12abAB'+string.printable[62:]
     for c in short: