comparison src/testdir/test_expr.vim @ 8635:3a38d465f731 v7.4.1607

commit https://github.com/vim/vim/commit/f0e86a0dbddc18568910e9e4aaae0cd88ca8087a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 19 19:38:12 2016 +0100 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.
author Christian Brabandt <cb@256bit.org>
date Sat, 19 Mar 2016 19:45:05 +0100
parents
children 03e5171c23e5
comparison
equal deleted inserted replaced
8634:416fa8415ada 8635:3a38d465f731
1 " Tests for expressions.
2
3 func Test_equal()
4 let base = {}
5 func base.method()
6 return 1
7 endfunc
8 func base.other() dict
9 return 1
10 endfunc
11 let instance = copy(base)
12 call assert_true(base.method == instance.method)
13 call assert_true([base.method] == [instance.method])
14 call assert_true(base.other == instance.other)
15 call assert_true([base.other] == [instance.other])
16
17 call assert_false(base.method == base.other)
18 call assert_false([base.method] == [base.other])
19 call assert_false(base.method == instance.other)
20 call assert_false([base.method] == [instance.other])
21
22 call assert_fails('echo base.method > instance.method')
23 endfunc