aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-12-27 22:49:44 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-12-27 22:49:44 +0100
commitc1015121ec626cab6cb384f544bc0be1a1760c0e (patch)
tree6cc9a5d1899a4486a24c491e07d17a7dd01f9503 /test/functional/terminal
parent4f030ec24e0e148bbb83aedaef7dd629e5fef130 (diff)
parente1876c7ad1b5e30c0a9919e2c4587d11550c8507 (diff)
downloadrneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.tar.gz
rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.tar.bz2
rneovim-c1015121ec626cab6cb384f544bc0be1a1760c0e.zip
Merge 'upstream/master' into pr-win-erw7
Diffstat (limited to 'test/functional/terminal')
-rw-r--r--test/functional/terminal/helpers.lua2
-rw-r--r--test/functional/terminal/highlight_spec.lua2
-rw-r--r--test/functional/terminal/tui_spec.lua20
-rw-r--r--test/functional/terminal/window_split_tab_spec.lua20
4 files changed, 26 insertions, 18 deletions
diff --git a/test/functional/terminal/helpers.lua b/test/functional/terminal/helpers.lua
index bd24b9785d..ae8d4704e4 100644
--- a/test/functional/terminal/helpers.lua
+++ b/test/functional/terminal/helpers.lua
@@ -52,7 +52,7 @@ local function screen_setup(extra_rows, command, cols)
[7] = {foreground = 130},
[8] = {foreground = 15, background = 1}, -- error message
[9] = {foreground = 4},
- [10] = {foreground = 2}, -- "Press ENTER" in embedded :terminal session.
+ [10] = {foreground = 121}, -- "Press ENTER" in embedded :terminal session.
})
screen:attach({rgb=false})
diff --git a/test/functional/terminal/highlight_spec.lua b/test/functional/terminal/highlight_spec.lua
index fddc0bbb71..f33959c58d 100644
--- a/test/functional/terminal/highlight_spec.lua
+++ b/test/functional/terminal/highlight_spec.lua
@@ -120,7 +120,7 @@ describe('terminal window highlighting with custom palette', function()
clear()
screen = Screen.new(50, 7)
screen:set_default_attr_ids({
- [1] = {foreground = 1193046, special = Screen.colors.Black},
+ [1] = {foreground = tonumber('0x123456')},
[2] = {foreground = 12},
[3] = {bold = true, reverse = true},
[5] = {background = 11},
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index 365bd2a0be..1b4441f25f 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -134,15 +134,17 @@ describe('tui', function()
feed_data('\022\007') -- ctrl+g
feed_data('\022\022') -- ctrl+v
feed_data('\022\013') -- ctrl+m
+ local attrs = screen:get_default_attr_ids()
+ attrs[11] = {foreground = 81}
screen:expect([[
- {9:^G^V^M}{1: } |
+ {11:^G^V^M}{1: } |
{4:~ }|
{4:~ }|
{4:~ }|
{5:[No Name] [+] }|
{3:-- INSERT --} |
{3:-- TERMINAL --} |
- ]])
+ ]], attrs)
end)
it('automatically sends <Paste> for bracketed paste sequences', function()
@@ -205,14 +207,14 @@ describe('tui', function()
screen:set_option('rgb', true)
screen:set_default_attr_ids({
[1] = {reverse = true},
- [2] = {foreground = 13, special = Screen.colors.Grey0},
- [3] = {bold = true, reverse = true, special = Screen.colors.Grey0},
+ [2] = {foreground = 13},
+ [3] = {bold = true, reverse = true},
[4] = {bold = true},
- [5] = {special = Screen.colors.Grey0, reverse = true, foreground = 4},
- [6] = {foreground = 4, special = Screen.colors.Grey0},
- [7] = {special = Screen.colors.Grey0, reverse = true, foreground = Screen.colors.SeaGreen4},
- [8] = {foreground = Screen.colors.SeaGreen4, special = Screen.colors.Grey0},
- [9] = {special = Screen.colors.Grey0, bold = true, foreground = Screen.colors.Blue1},
+ [5] = {reverse = true, foreground = 4},
+ [6] = {foreground = 4},
+ [7] = {reverse = true, foreground = Screen.colors.SeaGreen4},
+ [8] = {foreground = Screen.colors.SeaGreen4},
+ [9] = {bold = true, foreground = Screen.colors.Blue1},
})
feed_data(':hi SpecialKey ctermfg=3 guifg=SeaGreen\n')
diff --git a/test/functional/terminal/window_split_tab_spec.lua b/test/functional/terminal/window_split_tab_spec.lua
index 07cc8020a5..fecffe3295 100644
--- a/test/functional/terminal/window_split_tab_spec.lua
+++ b/test/functional/terminal/window_split_tab_spec.lua
@@ -7,6 +7,7 @@ local command = helpers.command
local eq = helpers.eq
local eval = helpers.eval
local iswin = helpers.iswin
+local retry = helpers.retry
describe('terminal', function()
local screen
@@ -67,17 +68,22 @@ describe('terminal', function()
end)
it('forwards resize request to the program', function()
- feed([[<C-\><C-N>:]]) -- Go to cmdline-mode, so cursor is at bottom.
- screen:try_resize(screen._width - 3, screen._height - 2)
+ feed([[<C-\><C-N>G:]]) -- Go to cmdline-mode, so cursor is at bottom.
+ local w1, h1 = screen._width - 3, screen._height - 2
+ local w2, h2 = w1 - 6, h1 - 3
if iswin() then
- -- win: less-precise test, SIGWINCH is noisy there. #7506
- screen:expect{any='rows: 7, cols: 47'}
- screen:try_resize(screen._width - 6, screen._height - 3)
- screen:expect{any='rows: 4, cols: 41'}
+ -- win: SIGWINCH is unreliable, use a weaker test. #7506
+ retry(3, 30000, function()
+ screen:try_resize(w1, h1)
+ screen:expect{any='rows: 7, cols: 47'}
+ screen:try_resize(w2, h2)
+ screen:expect{any='rows: 4, cols: 41'}
+ end)
return
end
+ screen:try_resize(w1, h1)
screen:expect([[
tty ready |
rows: 7, cols: 47 |
@@ -88,7 +94,7 @@ describe('terminal', function()
|
:^ |
]])
- screen:try_resize(screen._width - 6, screen._height - 3)
+ screen:try_resize(w2, h2)
screen:expect([[
tty ready |
rows: 7, cols: 47 |