]> git.madduck.net Git - etc/vim.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Add tests for `ge` command
authorHiroshi Shirosaki <h.shirosaki@gmail.com>
Thu, 16 Mar 2017 01:50:13 +0000 (10:50 +0900)
committerHiroshi Shirosaki <h.shirosaki@gmail.com>
Thu, 16 Mar 2017 01:50:56 +0000 (10:50 +0900)
test/ge_test.md [new file with mode: 0644]
test/map.vader

diff --git a/test/ge_test.md b/test/ge_test.md
new file mode 100644 (file)
index 0000000..0f5e100
--- /dev/null
@@ -0,0 +1 @@
+ge test
index 92947f5972a8254c4d485efc5b5daa58521c5c64..7ecdfad188da56b79695f9cf04583ef8f2506aa7 100644 (file)
@@ -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