comparison src/testdir/test_buffer.vim @ 25234:34a6db7af738 v8.2.3153

patch 8.2.3153: URLs with a dash in the scheme are not recognized Commit: https://github.com/vim/vim/commit/7b7a118e74d25ff35cd277c2bb5191ae44bb20b2 Author: Tsuyoshi CHO <Tsuyoshi.CHO@Gmail.com> Date: Sun Jul 11 21:51:17 2021 +0200 patch 8.2.3153: URLs with a dash in the scheme are not recognized 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Jul 2021 22:00:05 +0200
parents d7644bffe128
children 856b56468157
comparison
equal deleted inserted replaced
25233:f6a78c6350ff 25234:34a6db7af738
379 balt +3 OtherBuffer 379 balt +3 OtherBuffer
380 e # 380 e #
381 call assert_equal('OtherBuffer', bufname()) 381 call assert_equal('OtherBuffer', bufname())
382 endfunc 382 endfunc
383 383
384 " Test for buffer match URL(scheme) check
385 " scheme is alpha and inner hyphen only.
386 func Test_buffer_scheme()
387 CheckMSWindows
388
389 set noshellslash
390 %bwipe!
391 let bufnames = [
392 \ #{id: 'b0', name: 'test://xyz/foo/b0' , match: 1},
393 \ #{id: 'b1', name: 'test+abc://xyz/foo/b1', match: 0},
394 \ #{id: 'b2', name: 'test_abc://xyz/foo/b2', match: 0},
395 \ #{id: 'b3', name: 'test-abc://xyz/foo/b3', match: 1},
396 \ #{id: 'b4', name: '-test://xyz/foo/b4' , match: 0},
397 \ #{id: 'b5', name: 'test-://xyz/foo/b5' , match: 0},
398 \]
399 for buf in bufnames
400 new `=buf.name`
401 if buf.match
402 call assert_equal(buf.name, getbufinfo(buf.id)[0].name)
403 else
404 " slashes will have become backslashes
405 call assert_notequal(buf.name, getbufinfo(buf.id)[0].name)
406 endif
407 bwipe
408 endfor
409
410 set shellslash&
411 endfunc
412
384 " Test for the 'maxmem' and 'maxmemtot' options 413 " Test for the 'maxmem' and 'maxmemtot' options
385 func Test_buffer_maxmem() 414 func Test_buffer_maxmem()
386 " use 1KB per buffer and 2KB for all the buffers 415 " use 1KB per buffer and 2KB for all the buffers
387 set maxmem=1 maxmemtot=2 416 set maxmem=1 maxmemtot=2
388 new 417 new