aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/terminal/buffer_spec.lua22
-rw-r--r--test/functional/ui/screen.lua14
-rw-r--r--test/functional/ui/screen_basic_spec.lua5
-rw-r--r--test/includes/CMakeLists.txt7
-rw-r--r--test/includes/pre/uv.h (renamed from test/includes/pre/uv-errno.h)2
-rw-r--r--test/unit/os/fs_spec.lua2
6 files changed, 40 insertions, 12 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index 4ce33fef7b..c290031fbe 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -201,6 +201,28 @@ describe('terminal buffer', function()
feed([[<C-\><C-n>]])
feed_command('bdelete!')
end)
+
+ describe('handles confirmations', function()
+ it('with :confirm', function()
+ feed_command('terminal')
+ feed('<c-\\><c-n>')
+ feed_command('confirm bdelete')
+ screen:expect('Close "term://', nil, true, nil, true)
+ end)
+
+ it('with &confirm', function()
+ feed_command('terminal')
+ feed('<c-\\><c-n>')
+ feed_command('bdelete')
+ screen:expect('E89', nil, true, nil, true)
+ feed('<cr>')
+ eq('terminal', eval('&buftype'))
+ feed_command('set confirm | bdelete')
+ screen:expect('Close "term://', nil, true, nil, true)
+ feed('y')
+ neq('terminal', eval('&buftype'))
+ end)
+ end)
end)
describe('No heap-buffer-overflow when using', function()
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua
index 52e108f389..7607131e9b 100644
--- a/test/functional/ui/screen.lua
+++ b/test/functional/ui/screen.lua
@@ -172,9 +172,6 @@ end
function Screen:try_resize(columns, rows)
uimeths.try_resize(columns, rows)
- -- Give ourselves a chance to _handle_resize, which requires using
- -- self.sleep() (for the resize notification) rather than run()
- self:sleep(0.1)
end
function Screen:set_option(option, value)
@@ -210,11 +207,6 @@ function Screen:expect(expected, attr_ids, attr_ignore, condition, any)
row = row:sub(1, #row - 1) -- Last char must be the screen delimiter.
table.insert(expected_rows, row)
end
- if not any then
- assert(self._height == #expected_rows,
- "Expected screen state's row count(" .. #expected_rows
- .. ') differs from configured height(' .. self._height .. ') of Screen.')
- end
end
local ids = attr_ids or self._default_attr_ids
local ignore = attr_ignore or self._default_attr_ignore
@@ -225,6 +217,12 @@ function Screen:expect(expected, attr_ids, attr_ignore, condition, any)
return tostring(res)
end
end
+
+ if expected and not any and self._height ~= #expected_rows then
+ return ("Expected screen state's row count(" .. #expected_rows
+ .. ') differs from configured height(' .. self._height .. ') of Screen.')
+ end
+
local actual_rows = {}
for i = 1, self._height do
actual_rows[i] = self:_row_repr(self._rows[i], ids, ignore)
diff --git a/test/functional/ui/screen_basic_spec.lua b/test/functional/ui/screen_basic_spec.lua
index 06e4a19354..6f04cde4d4 100644
--- a/test/functional/ui/screen_basic_spec.lua
+++ b/test/functional/ui/screen_basic_spec.lua
@@ -651,9 +651,10 @@ describe('Screen', function()
it('has minimum width/height values', function()
screen:try_resize(1, 1)
screen:expect([[
- {2:-- INS^ERT --}|
- |
+ resize^ |
+ {2:-- INSERT -} |
]])
+
feed('<esc>:ls')
screen:expect([[
resize |
diff --git a/test/includes/CMakeLists.txt b/test/includes/CMakeLists.txt
index 2846df0e37..4d7e962fbd 100644
--- a/test/includes/CMakeLists.txt
+++ b/test/includes/CMakeLists.txt
@@ -7,6 +7,13 @@ foreach(gen_include ${CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES})
list(APPEND gen_cflags ${CMAKE_INCLUDE_FLAG_C}${gen_include})
endforeach()
+get_directory_property(gen_cdefs COMPILE_DEFINITIONS)
+foreach(gen_cdef ${gen_cdefs})
+ if(NOT ${gen_cdef} MATCHES "INCLUDE_GENERATED_DECLARATIONS")
+ list(APPEND gen_cflags "-D${gen_cdef}")
+ endif()
+endforeach()
+
foreach(hfile ${PRE_HEADERS})
string(REGEX REPLACE ^pre/ post/ post_hfile ${hfile})
get_filename_component(hdir ${CMAKE_CURRENT_BINARY_DIR}/${post_hfile} PATH)
diff --git a/test/includes/pre/uv-errno.h b/test/includes/pre/uv.h
index 6b80f60e5c..da7818cd07 100644
--- a/test/includes/pre/uv-errno.h
+++ b/test/includes/pre/uv.h
@@ -1,4 +1,4 @@
-#include <uv-errno.h>
+#include <uv.h>
static const int kUV_ENOENT = UV_ENOENT;
static const int kUV_EEXIST = UV_EEXIST;
diff --git a/test/unit/os/fs_spec.lua b/test/unit/os/fs_spec.lua
index ae6dfe6423..ddb438eb3d 100644
--- a/test/unit/os/fs_spec.lua
+++ b/test/unit/os/fs_spec.lua
@@ -27,7 +27,7 @@ cimport('./src/nvim/fileio.h')
local fs = cimport('./src/nvim/os/os.h', './src/nvim/path.h')
cppimport('sys/stat.h')
cppimport('fcntl.h')
-cppimport('uv-errno.h')
+cppimport('uv.h')
local s = ''
for i = 0, 255 do