summaryrefslogtreecommitdiff
path: root/src/testdir/test_expr.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-19 19:38:12 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-19 19:38:12 +0100
commitf0e86a0dbddc18568910e9e4aaae0cd88ca8087a (patch)
treecd3a18a36ff0037bfc7f47c83ed2e4c66967cb8e /src/testdir/test_expr.vim
parent953cc7fb139dc2ba8590f8b03a095b63f4e1208f (diff)
downloadvim-git-f0e86a0dbddc18568910e9e4aaae0cd88ca8087a.tar.gz
patch 7.4.1607v7.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.
Diffstat (limited to 'src/testdir/test_expr.vim')
-rw-r--r--src/testdir/test_expr.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim
new file mode 100644
index 000000000..8e55bc53f
--- /dev/null
+++ b/src/testdir/test_expr.vim
@@ -0,0 +1,23 @@
+" Tests for expressions.
+
+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