diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-12-14 16:41:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-14 16:41:08 +0800 |
commit | aa05133b0e4e2157275936c31adbbd5b739b716d (patch) | |
tree | 7b9600db0236bd355ba93ddc10bcfebd6b6c6740 | |
parent | 619407eb548c7df56bc99b945338e9446f846fbb (diff) | |
download | rneovim-aa05133b0e4e2157275936c31adbbd5b739b716d.tar.gz rneovim-aa05133b0e4e2157275936c31adbbd5b739b716d.tar.bz2 rneovim-aa05133b0e4e2157275936c31adbbd5b739b716d.zip |
test(nvim_open_term): don't resize after creating terminal (#26570)
This makes the screen states consistently have no EOB lines.
-rw-r--r-- | test/functional/terminal/channel_spec.lua | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/test/functional/terminal/channel_spec.lua b/test/functional/terminal/channel_spec.lua index b9abcd61c8..cb63c35deb 100644 --- a/test/functional/terminal/channel_spec.lua +++ b/test/functional/terminal/channel_spec.lua @@ -192,12 +192,21 @@ describe('no crash when TermOpen autocommand', function() ]]} assert_alive() end) +end) - it('nvim_open_term({force_crlf=true}) converts newlines', function() - local buf = meths.create_buf(false, true) +describe('nvim_open_term', function() + local screen + + before_each(function() + clear() + screen = Screen.new(8, 10) + screen:attach() + end) + + it('with force_crlf=true converts newlines', function() local win = meths.get_current_win() + local buf = meths.create_buf(false, true) local term = meths.open_term(buf, {force_crlf = true}) - screen:try_resize(8, 10) meths.win_set_buf(win, buf) meths.chan_send(term, 'here\nthere\nfoo\r\nbar\n\ntest') screen:expect{grid=[[ @@ -207,10 +216,7 @@ describe('no crash when TermOpen autocommand', function() bar | | test | - {0:~ }| - {0:~ }| - {0:~ }| - | + |*4 ]]} meths.chan_send(term, '\nfirst') screen:expect{grid=[[ @@ -221,26 +227,20 @@ describe('no crash when TermOpen autocommand', function() | test | first | - {0:~ }| - {0:~ }| - | + |*3 ]]} - meths.buf_delete(buf, {force = true}) - buf = meths.create_buf(false, true) - term = meths.open_term(buf, {force_crlf = false}) + end) + + it('with force_crlf=false does not convert newlines', function() + local win = meths.get_current_win() + local buf = meths.create_buf(false, true) + local term = meths.open_term(buf, {force_crlf = false}) meths.win_set_buf(win, buf) meths.chan_send(term, 'here\nthere') screen:expect{grid=[[ ^here | there | - | - | - | - | - | - | - | - | + |*8 ]]} end) end) |