From: Hiroshi Shirosaki Date: Thu, 16 Mar 2017 01:50:13 +0000 (+0900) Subject: Add tests for `ge` command X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/7cb6bd72ae0d906395e41e75b193407c76ac3dd5?hp=ab8ecf0bc73a792c60ad7a8a303290ccf89aa4e5 Add tests for `ge` command --- diff --git a/test/ge_test.md b/test/ge_test.md new file mode 100644 index 0000000..0f5e100 --- /dev/null +++ b/test/ge_test.md @@ -0,0 +1 @@ +ge test diff --git a/test/map.vader b/test/map.vader index 92947f5..7ecdfad 100644 --- a/test/map.vader +++ b/test/map.vader @@ -50,6 +50,45 @@ Execute (gx autolink): AssertEqual b:func(1, match(b:line, ')') + 1), b:url AssertEqual b:func(1, match(b:line, 'd') + 1), '' +Given markdown; +[ge_test.md](ge_test.md) + +Execute (ge opens file): + normal ge + AssertEqual @%, 'ge_test.md' + AssertEqual getline(1), 'ge test' + +Given markdown; +[ge_test](ge_test) + +Execute (ge opens file without .md extensions): + let g:vim_markdown_no_extensions_in_markdown = 1 + normal ge + AssertEqual @%, 'ge_test.md' + AssertEqual getline(1), 'ge test' + unlet g:vim_markdown_no_extensions_in_markdown + +Given markdown; +[ge_test.md](ge_test.md) + +Execute (ge does not write before opening file): + normal ia + normal l + normal ge + AssertEqual @%, 'ge_test.md' + AssertEqual getline(1), 'ge test' + +Given markdown; +[ge_test.md](ge_test.md) + +Execute (ge auto-write before opening file): + let g:vim_markdown_autowrite = 1 + normal ia + normal l + AssertThrows normal ge + AssertEqual g:vader_exception, 'Vim(write):E382: Cannot write, ''buftype'' option is set' + unlet g:vim_markdown_autowrite + Given markdown; # a