def testReflowTable(self): self.load_fixture_in_vim('reflow') expect = """\ This is paragraph text *before* the table. +----------+--------------------------+ | Column 1 | Column 2 | +==========+==========================+ | Foo | Put two (or more) spaces | | | as a field separator. | +----------+--------------------------+ | Bar | Even very very long | | | lines like these are | | | fine, as long as you do | | | not put in line endings | | | here. | +----------+--------------------------+ | Qux | This is the last line. | +----------+--------------------------+ This is paragraph text *after* the table, with a line ending. """.split('\n') reflow_table() self.assertEquals(expect, vim.current.buffer)
def reflow_table_vim(self, expect, input): text_before_table = 'A piece of text before the table.\n\n' vim.current.buffer = (text_before_table + input).split('\n') reflow_table() self.assertEqual((text_before_table + expect).split('\n'), vim.current.buffer)