aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-01-27 08:32:02 +0100
committerGitHub <noreply@github.com>2022-01-27 08:32:02 +0100
commit47b50d5a1c8c9ffb330cbac817c0235bc6298457 (patch)
tree62106738070e5fbce11eb1eac5c06d209162632b /src/nvim/testdir
parentf1b91fcdbdf5f2e639aed8155c6d668c0b33ec6c (diff)
parentc0a97d982ae0ce56e70dfdac9c5ec8bd7e99c32d (diff)
downloadrneovim-47b50d5a1c8c9ffb330cbac817c0235bc6298457.tar.gz
rneovim-47b50d5a1c8c9ffb330cbac817c0235bc6298457.tar.bz2
rneovim-47b50d5a1c8c9ffb330cbac817c0235bc6298457.zip
Merge pull request #17174 from zeertzjq/vim-8.2.3153
vim-patch:8.2.3153: URLs with a dash in the scheme are not recognized
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_buffer.vim31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_buffer.vim b/src/nvim/testdir/test_buffer.vim
index 40111fdf06..a31cdbb49a 100644
--- a/src/nvim/testdir/test_buffer.vim
+++ b/src/nvim/testdir/test_buffer.vim
@@ -1,5 +1,7 @@
" Tests for Vim buffer
+source check.vim
+
func Test_buffer_error()
new foo1
new foo2
@@ -30,4 +32,33 @@ func Test_balt()
call assert_equal('OtherBuffer', bufname())
endfunc
+" Test for buffer match URL(scheme) check
+" scheme is alpha and inner hyphen only.
+func Test_buffer_scheme()
+ CheckMSWindows
+
+ set noshellslash
+ %bwipe!
+ let bufnames = [
+ \ #{id: 'b0', name: 'test://xyz/foo/b0' , match: 1},
+ \ #{id: 'b1', name: 'test+abc://xyz/foo/b1', match: 0},
+ \ #{id: 'b2', name: 'test_abc://xyz/foo/b2', match: 0},
+ \ #{id: 'b3', name: 'test-abc://xyz/foo/b3', match: 1},
+ \ #{id: 'b4', name: '-test://xyz/foo/b4' , match: 0},
+ \ #{id: 'b5', name: 'test-://xyz/foo/b5' , match: 0},
+ \]
+ for buf in bufnames
+ new `=buf.name`
+ if buf.match
+ call assert_equal(buf.name, getbufinfo(buf.id)[0].name)
+ else
+ " slashes will have become backslashes
+ call assert_notequal(buf.name, getbufinfo(buf.id)[0].name)
+ endif
+ bwipe
+ endfor
+
+ set shellslash&
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab