summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_buffer.vim
diff options
context:
space:
mode:
authorTsuyoshi CHO <Tsuyoshi.CHO@Gmail.com>2021-07-11 21:51:17 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-11 21:51:17 +0200
commit7b7a118e74d25ff35cd277c2bb5191ae44bb20b2 (patch)
treee7d94d705f0d7c0c38f6a40498f07a01a186beba /src/testdir/test_buffer.vim
parent11005b078d2485a306c74f77c9dd158fdd7f3cbe (diff)
patch 8.2.3153: URLs with a dash in the scheme are not recognizedv8.2.3153
Problem: URLs with a dash in the scheme are not recognized. Solution: Allow for a scheme with a dash, but not at the start or end. (Tsuyoshi CHO, closes #8299)
Diffstat (limited to 'src/testdir/test_buffer.vim')
-rw-r--r--src/testdir/test_buffer.vim29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/testdir/test_buffer.vim b/src/testdir/test_buffer.vim
index 960a760ebd..aa2fe7ac64 100644
--- a/src/testdir/test_buffer.vim
+++ b/src/testdir/test_buffer.vim
@@ -381,6 +381,35 @@ 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
+
" Test for the 'maxmem' and 'maxmemtot' options
func Test_buffer_maxmem()
" use 1KB per buffer and 2KB for all the buffers