mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Handle edge case in common prefix calculation
This commit is contained in:
@@ -916,6 +916,9 @@ endfunction
|
||||
|
||||
|
||||
function Test_common_prefix()
|
||||
" zero length
|
||||
call assert_equal(-1, gitgutter#diff_highlight#common_prefix('', 'foo'))
|
||||
call assert_equal(-1, gitgutter#diff_highlight#common_prefix('foo', ''))
|
||||
" nothing in common
|
||||
call assert_equal(-1, gitgutter#diff_highlight#common_prefix('-abcde', '+pqrst'))
|
||||
call assert_equal(-1, gitgutter#diff_highlight#common_prefix('abcde', 'pqrst'))
|
||||
|
||||
Reference in New Issue
Block a user