summaryrefslogtreecommitdiff
path: root/src/testdir/test_terminal.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-03-24 14:30:32 +0100
committerBram Moolenaar <Bram@vim.org>2018-03-24 14:30:32 +0100
commit45d2a64f964238753403017b6d0ef30be88ccf37 (patch)
tree51d38cec2852309e24411e0d1bb03962543b2de9 /src/testdir/test_terminal.vim
parent16d7eced1a08565a9837db8067c7b9db5ed68854 (diff)
downloadvim-45d2a64f964238753403017b6d0ef30be88ccf37.zip
patch 8.0.1636: no test for term_dumpload() and term_dumpdiff()
Problem: No test for term_dumpload() and term_dumpdiff(). Solution: Add tests.
Diffstat (limited to 'src/testdir/test_terminal.vim')
-rw-r--r--src/testdir/test_terminal.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index 78f73b6fb..29e2d7b13 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -968,3 +968,30 @@ func Test_terminal_open_autocmd()
unlet s:called
au! repro
endfunction
+
+func Check_dump01(off)
+ call assert_equal('one two three four five', trim(getline(a:off + 1)))
+ call assert_equal('~ Select Word', trim(getline(a:off + 7)))
+ call assert_equal(':popup PopUp :', trim(getline(a:off + 20)))
+endfunc
+
+" just testing basic functionality.
+func Test_terminal_dumpload()
+ call assert_equal(1, winnr('$'))
+ call term_dumpload('dumps/Test_popup_command_01.dump')
+ call assert_equal(2, winnr('$'))
+ call assert_equal(20, line('$'))
+ call Check_dump01(0)
+ quit
+endfunc
+
+func Test_terminal_dumpdiff()
+ call assert_equal(1, winnr('$'))
+ call term_dumpdiff('dumps/Test_popup_command_01.dump', 'dumps/Test_popup_command_02.dump')
+ call assert_equal(2, winnr('$'))
+ call assert_equal(62, line('$'))
+ call Check_dump01(0)
+ call Check_dump01(42)
+ call assert_equal(' bbbbbbbbbbbbbbbbbb ', getline(26)[0:29])
+ quit
+endfunc