aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/003_cindent_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/legacy/003_cindent_spec.lua')
-rw-r--r--test/functional/legacy/003_cindent_spec.lua80
1 files changed, 79 insertions, 1 deletions
diff --git a/test/functional/legacy/003_cindent_spec.lua b/test/functional/legacy/003_cindent_spec.lua
index 27835fea28..1cede8a7d7 100644
--- a/test/functional/legacy/003_cindent_spec.lua
+++ b/test/functional/legacy/003_cindent_spec.lua
@@ -1,4 +1,5 @@
-- Test for 'cindent'.
+-- For new tests, consider putting them in test_cindent.vim.
--
-- There are 50+ test command blocks (the stuff between STARTTEST and ENDTEST)
-- in the original test. These have been converted to "it" test cases here.
@@ -15,6 +16,8 @@ local function insert_(content)
feed_command('1', 'set cin ts=4 sw=4')
end
+-- luacheck: ignore 621 (Indentation)
+-- luacheck: ignore 613 (Trailing whitespace in a string)
describe('cindent', function()
before_each(clear)
@@ -1954,7 +1957,8 @@ describe('cindent', function()
}
]=])
- feed_command('set tw=0 wm=60 columns=80 noai fo=croq')
+ feed_command('set tw=0 noai fo=croq')
+ feed_command('let &wm = &columns - 20')
feed_command('/serious/e')
feed('a about life, the universe, and the rest<esc>')
@@ -3915,6 +3919,26 @@ describe('cindent', function()
{
111111111111111111;
}
+ namespace test::cpp17
+ {
+ 111111111111111111;
+ }
+ namespace ::incorrectcpp17
+ {
+ 111111111111111111;
+ }
+ namespace test::incorrectcpp17::
+ {
+ 111111111111111111;
+ }
+ namespace test:incorrectcpp17
+ {
+ 111111111111111111;
+ }
+ namespace test:::incorrectcpp17
+ {
+ 111111111111111111;
+ }
namespace{
111111111111111111;
}
@@ -3986,6 +4010,26 @@ describe('cindent', function()
{
111111111111111111;
}
+ namespace test::cpp17
+ {
+ 111111111111111111;
+ }
+ namespace ::incorrectcpp17
+ {
+ 111111111111111111;
+ }
+ namespace test::incorrectcpp17::
+ {
+ 111111111111111111;
+ }
+ namespace test:incorrectcpp17
+ {
+ 111111111111111111;
+ }
+ namespace test:::incorrectcpp17
+ {
+ 111111111111111111;
+ }
namespace{
111111111111111111;
}
@@ -4676,4 +4720,38 @@ describe('cindent', function()
JSEND
]=])
end)
+
+ it('line continuations in macros / vim-patch 8.0.0148', function()
+ insert_([=[
+ /* start of define */
+ {
+ }
+ #define AAA \
+ BBB\
+ CCC
+
+ #define CNT \
+ 1 + \
+ 2 + \
+ 4
+ /* end of define */]=])
+
+ feed_command('set cino&')
+ feed_command('/start of define')
+ feed('=/end of define<cr>')
+
+ expect([=[
+ /* start of define */
+ {
+ }
+ #define AAA \
+ BBB\
+ CCC
+
+ #define CNT \
+ 1 + \
+ 2 + \
+ 4
+ /* end of define */]=])
+ end)
end)