From 2ced866925ae554e6b978b798073eba0c96c96bd Mon Sep 17 00:00:00 2001 From: Lucas Hoffmann Date: Fri, 15 May 2015 19:03:48 +0200 Subject: tests: Migrate legacy test 68. --- .../functional/legacy/068_text_formatting_spec.lua | 209 +++++++++++++++++++++ 1 file changed, 209 insertions(+) create mode 100644 test/functional/legacy/068_text_formatting_spec.lua (limited to 'test/functional') diff --git a/test/functional/legacy/068_text_formatting_spec.lua b/test/functional/legacy/068_text_formatting_spec.lua new file mode 100644 index 0000000000..0e3d66e0e5 --- /dev/null +++ b/test/functional/legacy/068_text_formatting_spec.lua @@ -0,0 +1,209 @@ +-- Test for text formatting. + +local helpers = require('test.functional.helpers') +local feed, insert, source = helpers.feed, helpers.insert, helpers.source +local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect + +describe('text formatting', function() + setup(clear) + + it('is working', function() + -- The control character (byte \x01) needs to be put in the buffer + -- directly. But the insert function sends the text to nvim in insert + -- mode so it has to be escaped with . + insert([[ + Results of test68: + + + { + + + } + + + { + a b + + a + } + + + { + a  + } + + + { + a b + #a b + } + + + { + 1 a + # 1 a + } + + + { + + x a + b + c + + } + + + { + # 1 a b + } + + + { + # x + # a b + } + + + { + 1aa + 2bb + } + + + /* abc def ghi jkl + * mno pqr stu + */ + + + # 1 xxxxx + ]]) + + execute('/^{/+1') + execute('set noai tw=2 fo=t') + feed('gRa b') + + execute('/^{/+1') + execute('set ai tw=2 fo=tw') + feed('gqgqjjllab') + + execute('/^{/+1') + execute('set tw=3 fo=t') + feed('gqgqo') + feed('a ') + + execute('/^{/+1') + execute('set tw=2 fo=tcq1 comments=:#') + feed('gqgqjgqgqo') + feed('a b') + feed('#a b') + + execute('/^{/+1') + execute('set tw=5 fo=tcn comments=:#') + feed('A bjA b') + + execute('/^{/+3') + execute('set tw=5 fo=t2a si') + feed('i A_') + + execute('/^{/+1') + execute('set tw=5 fo=qn comments=:#') + feed('gwap') + + execute('/^{/+1') + execute('set tw=5 fo=q2 comments=:#') + feed('gwap') + + execute('/^{/+2') + execute('set tw& fo=a') + feed('I^^') + + execute('/mno pqr/') + execute('setl tw=20 fo=an12wcq comments=s1:/*,mb:*,ex:*/') + feed('A vwx yz') + + execute('/^#/') + execute('setl tw=12 fo=tqnc comments=:#') + feed('A foobar') + + -- Assert buffer contents. + expect([[ + Results of test68: + + + { + a + b + } + + + { + a + b + + a + b + } + + + { + a +  + + a +  + } + + + { + a b + #a b + + a b + #a b + } + + + { + 1 a + b + # 1 a + # b + } + + + { + + x a + b_ + c + + } + + + { + # 1 a + # b + } + + + { + # x a + # b + } + + + { 1aa ^^2bb } + + + /* abc def ghi jkl + * mno pqr stu + * vwx yz + */ + + + # 1 xxxxx + # foobar + ]]) + end) +end) -- cgit