mirror of
https://github.com/neovim/neovim.git
synced 2026-08-27 09:31:47 +00:00
vim-patch:7.4.1607
Problem: Comparing a function that exists on two dicts is not backwards
compatible. (Thinca)
Solution: Only compare the function, not what the partial adds.
f0e86a0dbd
This commit is contained in:
committed by
James McCoy
parent
5241ca7d7a
commit
3213b28c01
@@ -15,6 +15,28 @@ func Test_version()
|
||||
call assert_false(has('patch-9.9.1'))
|
||||
endfunc
|
||||
|
||||
func Test_equal()
|
||||
let base = {}
|
||||
func base.method()
|
||||
return 1
|
||||
endfunc
|
||||
func base.other() dict
|
||||
return 1
|
||||
endfunc
|
||||
let instance = copy(base)
|
||||
call assert_true(base.method == instance.method)
|
||||
call assert_true([base.method] == [instance.method])
|
||||
call assert_true(base.other == instance.other)
|
||||
call assert_true([base.other] == [instance.other])
|
||||
|
||||
call assert_false(base.method == base.other)
|
||||
call assert_false([base.method] == [base.other])
|
||||
call assert_false(base.method == instance.other)
|
||||
call assert_false([base.method] == [instance.other])
|
||||
|
||||
call assert_fails('echo base.method > instance.method')
|
||||
endfunc
|
||||
|
||||
func Test_strgetchar()
|
||||
call assert_equal(char2nr('a'), strgetchar('axb', 0))
|
||||
call assert_equal(char2nr('x'), strgetchar('axb', 1))
|
||||
|
||||
Reference in New Issue
Block a user