diff options
| author | Michael Ennen <mike.ennen@gmail.com> | 2016-10-27 14:05:27 -0700 |
|---|---|---|
| committer | James McCoy <jamessan@jamessan.com> | 2016-12-12 10:17:35 -0500 |
| commit | 3213b28c01313c7f0e7e0e01f72a0fbfef85fa3e (patch) | |
| tree | 63da27cc709c13e2d2afd4567680b6c24fdf9874 /src/nvim/testdir | |
| parent | 5241ca7d7a8c3a08af8bbfbf7cca3381241a915b (diff) | |
| download | rneovim-3213b28c01313c7f0e7e0e01f72a0fbfef85fa3e.tar.gz rneovim-3213b28c01313c7f0e7e0e01f72a0fbfef85fa3e.tar.bz2 rneovim-3213b28c01313c7f0e7e0e01f72a0fbfef85fa3e.zip | |
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.
https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_expr.vim | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_expr.vim b/src/nvim/testdir/test_expr.vim index 66a10b05e1..cc5e9587ed 100644 --- a/src/nvim/testdir/test_expr.vim +++ b/src/nvim/testdir/test_expr.vim @@ -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)) |