forked from aniani/vim
patch 8.1.2004: more functions can be used as methods
Problem: More functions can be used as methods. Solution: Make various functions usable as a method.
This commit is contained in:
@@ -53,7 +53,7 @@ endfunc
|
||||
|
||||
func Test_strgetchar()
|
||||
call assert_equal(char2nr('a'), strgetchar('axb', 0))
|
||||
call assert_equal(char2nr('x'), strgetchar('axb', 1))
|
||||
call assert_equal(char2nr('x'), 'axb'->strgetchar(1))
|
||||
call assert_equal(char2nr('b'), strgetchar('axb', 2))
|
||||
|
||||
call assert_equal(-1, strgetchar('axb', -1))
|
||||
@@ -63,7 +63,7 @@ endfunc
|
||||
|
||||
func Test_strcharpart()
|
||||
call assert_equal('a', strcharpart('axb', 0, 1))
|
||||
call assert_equal('x', strcharpart('axb', 1, 1))
|
||||
call assert_equal('x', 'axb'->strcharpart(1, 1))
|
||||
call assert_equal('b', strcharpart('axb', 2, 1))
|
||||
call assert_equal('xb', strcharpart('axb', 1))
|
||||
|
||||
|
Reference in New Issue
Block a user