From 656079a02e87c782698e2459e6202297b2ac041c 2012-06-23 03:21:52 From: Fernando Perez Date: 2012-06-23 03:21:52 Subject: [PATCH] Add failing test when pasting multiline strings with leading commas. See #1258. --- diff --git a/IPython/core/tests/test_magic_terminal.py b/IPython/core/tests/test_magic_terminal.py index 19d75bd..d7aa344 100644 --- a/IPython/core/tests/test_magic_terminal.py +++ b/IPython/core/tests/test_magic_terminal.py @@ -179,3 +179,13 @@ class PasteTestCase(TestCase): nt.assert_equal(ip.user_ns['b'], 200) nt.assert_equal(out, code+"\n## -- End pasted text --\n") + def test_paste_leading_commas(self): + "Test multiline strings with leading commas" + tm = ip.magics_manager.registry['TerminalMagics'] + s = '''\ +a = """ +,1,2,3 +"""''' + ip.user_ns.pop('foo', None) + tm.store_or_execute(s, 'foo') + nt.assert_in('foo', ip.user_ns)