diff --git a/IPython/core/tests/test_inputtransformer2_line.py b/IPython/core/tests/test_inputtransformer2_line.py index 263bbd9..f93c68f 100644 --- a/IPython/core/tests/test_inputtransformer2_line.py +++ b/IPython/core/tests/test_inputtransformer2_line.py @@ -61,11 +61,39 @@ for a in range(5): print(a ** 2) """) + +IPYTHON_PROMPT_VI_INS = ("""\ +[ins] In [11]: def a(): + ...: 123 + ...: + ...: 123 +""", """\ +def a(): + 123 + +123 +""") + +IPYTHON_PROMPT_VI_NAV = ("""\ +[nav] In [11]: def a(): + ...: 123 + ...: + ...: 123 +""", """\ +def a(): + 123 + +123 +""") + + def test_ipython_prompt(): - for sample, expected in [IPYTHON_PROMPT, IPYTHON_PROMPT_L2]: + for sample, expected in [IPYTHON_PROMPT, IPYTHON_PROMPT_L2, + IPYTHON_PROMPT_VI_INS, IPYTHON_PROMPT_VI_NAV]: nt.assert_equal(ipt2.ipython_prompt(sample.splitlines(keepends=True)), expected.splitlines(keepends=True)) + INDENT_SPACES = ("""\ if True: a = 3 @@ -123,4 +151,4 @@ CRLF_MAGIC = ([ def test_crlf_magic(): for sample, expected in [CRLF_MAGIC]: - nt.assert_equal(ipt2.cell_magic(sample), expected) \ No newline at end of file + nt.assert_equal(ipt2.cell_magic(sample), expected)