aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/tui_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/terminal/tui_spec.lua')
-rw-r--r--test/functional/terminal/tui_spec.lua49
1 files changed, 37 insertions, 12 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index ac30be1e58..225a1fc170 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -399,7 +399,15 @@ describe("tui 't_Co' (terminal colors)", function()
assert_term_colors("linux-16color", nil, 256)
end)
+ it("TERM=linux-256color uses 256 colors", function()
+ assert_term_colors("linux-256color", nil, 256)
+ end)
+
-- screen and tmux:
+ --
+ -- FreeBSD falls back to the built-in screen-256colour entry.
+ -- Linux and MacOS have a screen entry in external terminfo with 8 colours,
+ -- which is raised to 16 by COLORTERM.
it("TERM=screen no COLORTERM uses 8/256 colors", function()
if is_freebsd then
@@ -460,35 +468,48 @@ describe("tui 't_Co' (terminal colors)", function()
end)
-- rxvt and stterm:
+ --
+ -- FreeBSD and MacOS fall back to the built-in rxvt-256color and
+ -- st-256colour entries.
+ -- Linux has an rxvt, an st, and an st-16color entry in external terminfo
+ -- with 8, 8, and 16 colours respectively, which are raised to 256.
it("TERM=rxvt no COLORTERM uses 256 colors", function()
assert_term_colors("rxvt", nil, 256)
end)
+ it("TERM=rxvt COLORTERM=rxvt uses 256 colors", function()
+ assert_term_colors("rxvt", "rxvt", 256)
+ end)
+
it("TERM=rxvt-256color uses 256 colors", function()
assert_term_colors("rxvt-256color", nil, 256)
end)
- it("TERM=st no COLORTERM uses 8/256 colors", function()
- if is_freebsd then
- assert_term_colors("st", nil, 256)
- else
- assert_term_colors("st", nil, 8)
- end
+ it("TERM=st no COLORTERM uses 256 colors", function()
+ assert_term_colors("st", nil, 256)
end)
- it("TERM=st COLORTERM=st uses 16/256 colors", function()
- if is_freebsd then
- assert_term_colors("st", "st", 256)
- else
- assert_term_colors("st", "st", 16)
- end
+ it("TERM=st COLORTERM=st uses 256 colors", function()
+ assert_term_colors("st", "st", 256)
end)
it("TERM=st COLORTERM=st-256color uses 256 colors", function()
assert_term_colors("st", "st-256color", 256)
end)
+ it("TERM=st-16color no COLORTERM uses 8/256 colors", function()
+ assert_term_colors("st", nil, 256)
+ end)
+
+ it("TERM=st-16color COLORTERM=st uses 16/256 colors", function()
+ assert_term_colors("st", "st", 256)
+ end)
+
+ it("TERM=st-16color COLORTERM=st-256color uses 256 colors", function()
+ assert_term_colors("st", "st-256color", 256)
+ end)
+
it("TERM=st-256color uses 256 colors", function()
assert_term_colors("st-256color", nil, 256)
end)
@@ -499,6 +520,10 @@ describe("tui 't_Co' (terminal colors)", function()
assert_term_colors("interix", nil, 8)
end)
+ it("TERM=iTerm.app uses 256 colors", function()
+ assert_term_colors("iTerm.app", nil, 256)
+ end)
+
it("TERM=iterm uses 256 colors", function()
assert_term_colors("iterm", nil, 256)
end)