Mercurial > vim
annotate src/testdir/test_partial.vim @ 32515:d1794b2317b8 v9.0.1589
patch 9.0.1589: filetype test contains too many special characters
Commit: https://github.com/vim/vim/commit/b140c114f641ac4cd4fb04e7bdec031295264a8d
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon May 29 17:06:05 2023 +0100
patch 9.0.1589: filetype test contains too many special characters
Problem: Filetype test contains too many special characters.
Solution: Use Vim9 syntax for a few things.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 29 May 2023 18:15:03 +0200 |
parents | 86eb4aba16c3 |
children | ddd5eaa2c0dc |
rev | line source |
---|---|
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test binding arguments to a Funcref. |
9713
058e5ea0400e
commit https://github.com/vim/vim/commit/31440a1f2b6ae8a2f7ffdd4a8a3661eadc4df23c
Christian Brabandt <cb@256bit.org>
parents:
9416
diff
changeset
|
2 |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
3 source check.vim |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
4 |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 func MyFunc(arg1, arg2, arg3) |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 return a:arg1 . '/' . a:arg2 . '/' . a:arg3 |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 endfunc |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 func MySort(up, one, two) |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 if a:one == a:two |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 return 0 |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 endif |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 if a:up |
8546
996109e24f02
commit https://github.com/vim/vim/commit/790500a8e65bee295ef51a59dfa67ecbaab8ea17
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
14 return a:one > a:two ? 1 : -1 |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 endif |
8546
996109e24f02
commit https://github.com/vim/vim/commit/790500a8e65bee295ef51a59dfa67ecbaab8ea17
Christian Brabandt <cb@256bit.org>
parents:
8538
diff
changeset
|
16 return a:one < a:two ? 1 : -1 |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 endfunc |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 |
9416
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
19 func MyMap(sub, index, val) |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
20 return a:val - a:sub |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
21 endfunc |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
22 |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
23 func MyFilter(threshold, index, val) |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
24 return a:val > a:threshold |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
25 endfunc |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
26 |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 func Test_partial_args() |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 let Cb = function('MyFunc', ["foo", "bar"]) |
8583
537bbbd4e987
commit https://github.com/vim/vim/commit/65639032bb7b17996cd255d1508a1df4ad528a1f
Christian Brabandt <cb@256bit.org>
parents:
8581
diff
changeset
|
29 |
537bbbd4e987
commit https://github.com/vim/vim/commit/65639032bb7b17996cd255d1508a1df4ad528a1f
Christian Brabandt <cb@256bit.org>
parents:
8581
diff
changeset
|
30 call Cb("zzz") |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 call assert_equal("foo/bar/xxx", Cb("xxx")) |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call assert_equal("foo/bar/yyy", call(Cb, ["yyy"])) |
8593
dc36cef103de
commit https://github.com/vim/vim/commit/8a1bb046378f4bc68d6a04af2eab80fb3ce04da6
Christian Brabandt <cb@256bit.org>
parents:
8591
diff
changeset
|
33 let Cb2 = function(Cb) |
dc36cef103de
commit https://github.com/vim/vim/commit/8a1bb046378f4bc68d6a04af2eab80fb3ce04da6
Christian Brabandt <cb@256bit.org>
parents:
8591
diff
changeset
|
34 call assert_equal("foo/bar/zzz", Cb2("zzz")) |
dc36cef103de
commit https://github.com/vim/vim/commit/8a1bb046378f4bc68d6a04af2eab80fb3ce04da6
Christian Brabandt <cb@256bit.org>
parents:
8591
diff
changeset
|
35 let Cb3 = function(Cb, ["www"]) |
dc36cef103de
commit https://github.com/vim/vim/commit/8a1bb046378f4bc68d6a04af2eab80fb3ce04da6
Christian Brabandt <cb@256bit.org>
parents:
8591
diff
changeset
|
36 call assert_equal("foo/bar/www", Cb3()) |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 |
8548
24db3583c496
commit https://github.com/vim/vim/commit/346418c624f1bc7c04c98907134a2b284e6452dd
Christian Brabandt <cb@256bit.org>
parents:
8546
diff
changeset
|
38 let Cb = function('MyFunc', []) |
24db3583c496
commit https://github.com/vim/vim/commit/346418c624f1bc7c04c98907134a2b284e6452dd
Christian Brabandt <cb@256bit.org>
parents:
8546
diff
changeset
|
39 call assert_equal("a/b/c", Cb("a", "b", "c")) |
8593
dc36cef103de
commit https://github.com/vim/vim/commit/8a1bb046378f4bc68d6a04af2eab80fb3ce04da6
Christian Brabandt <cb@256bit.org>
parents:
8591
diff
changeset
|
40 let Cb2 = function(Cb, []) |
dc36cef103de
commit https://github.com/vim/vim/commit/8a1bb046378f4bc68d6a04af2eab80fb3ce04da6
Christian Brabandt <cb@256bit.org>
parents:
8591
diff
changeset
|
41 call assert_equal("a/b/d", Cb2("a", "b", "d")) |
dc36cef103de
commit https://github.com/vim/vim/commit/8a1bb046378f4bc68d6a04af2eab80fb3ce04da6
Christian Brabandt <cb@256bit.org>
parents:
8591
diff
changeset
|
42 let Cb3 = function(Cb, ["a", "b"]) |
dc36cef103de
commit https://github.com/vim/vim/commit/8a1bb046378f4bc68d6a04af2eab80fb3ce04da6
Christian Brabandt <cb@256bit.org>
parents:
8591
diff
changeset
|
43 call assert_equal("a/b/e", Cb3("e")) |
8548
24db3583c496
commit https://github.com/vim/vim/commit/346418c624f1bc7c04c98907134a2b284e6452dd
Christian Brabandt <cb@256bit.org>
parents:
8546
diff
changeset
|
44 |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 let Sort = function('MySort', [1]) |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 call assert_equal([1, 2, 3], sort([3, 1, 2], Sort)) |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 let Sort = function('MySort', [0]) |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 call assert_equal([3, 2, 1], sort([3, 1, 2], Sort)) |
9416
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
49 |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
50 let Map = function('MyMap', [2]) |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
51 call assert_equal([-1, 0, 1], map([1, 2, 3], Map)) |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
52 let Map = function('MyMap', [3]) |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
53 call assert_equal([-2, -1, 0], map([1, 2, 3], Map)) |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
54 |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
55 let Filter = function('MyFilter', [1]) |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
56 call assert_equal([2, 3], filter([1, 2, 3], Filter)) |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
57 let Filter = function('MyFilter', [2]) |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
58 call assert_equal([3], filter([1, 2, 3], Filter)) |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 endfunc |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 func MyDictFunc(arg1, arg2) dict |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 return self.name . '/' . a:arg1 . '/' . a:arg2 |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 endfunc |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 func Test_partial_dict() |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 let dict = {'name': 'hello'} |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 let Cb = function('MyDictFunc', ["foo", "bar"], dict) |
20156
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
68 call test_garbagecollect_now() |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 call assert_equal("hello/foo/bar", Cb()) |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 call assert_fails('Cb("xxx")', 'E492:') |
8548
24db3583c496
commit https://github.com/vim/vim/commit/346418c624f1bc7c04c98907134a2b284e6452dd
Christian Brabandt <cb@256bit.org>
parents:
8546
diff
changeset
|
71 |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 let Cb = function('MyDictFunc', ["foo"], dict) |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 call assert_equal("hello/foo/xxx", Cb("xxx")) |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 call assert_fails('Cb()', 'E492:') |
8548
24db3583c496
commit https://github.com/vim/vim/commit/346418c624f1bc7c04c98907134a2b284e6452dd
Christian Brabandt <cb@256bit.org>
parents:
8546
diff
changeset
|
75 |
24db3583c496
commit https://github.com/vim/vim/commit/346418c624f1bc7c04c98907134a2b284e6452dd
Christian Brabandt <cb@256bit.org>
parents:
8546
diff
changeset
|
76 let Cb = function('MyDictFunc', [], dict) |
24db3583c496
commit https://github.com/vim/vim/commit/346418c624f1bc7c04c98907134a2b284e6452dd
Christian Brabandt <cb@256bit.org>
parents:
8546
diff
changeset
|
77 call assert_equal("hello/ttt/xxx", Cb("ttt", "xxx")) |
24db3583c496
commit https://github.com/vim/vim/commit/346418c624f1bc7c04c98907134a2b284e6452dd
Christian Brabandt <cb@256bit.org>
parents:
8546
diff
changeset
|
78 call assert_fails('Cb("yyy")', 'E492:') |
24db3583c496
commit https://github.com/vim/vim/commit/346418c624f1bc7c04c98907134a2b284e6452dd
Christian Brabandt <cb@256bit.org>
parents:
8546
diff
changeset
|
79 |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 let Cb = function('MyDictFunc', dict) |
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 call assert_equal("hello/xxx/yyy", Cb("xxx", "yyy")) |
8548
24db3583c496
commit https://github.com/vim/vim/commit/346418c624f1bc7c04c98907134a2b284e6452dd
Christian Brabandt <cb@256bit.org>
parents:
8546
diff
changeset
|
82 call assert_fails('Cb("fff")', 'E492:') |
8583
537bbbd4e987
commit https://github.com/vim/vim/commit/65639032bb7b17996cd255d1508a1df4ad528a1f
Christian Brabandt <cb@256bit.org>
parents:
8581
diff
changeset
|
83 |
9416
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
84 let Cb = function('MyDictFunc', dict) |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
85 call assert_equal({"foo": "hello/foo/1", "bar": "hello/bar/2"}, map({"foo": 1, "bar": 2}, Cb)) |
cbf052ccb120
commit https://github.com/vim/vim/commit/b33c7eb5b813cb631b2b0ca5c4029e1788a09bde
Christian Brabandt <cb@256bit.org>
parents:
9183
diff
changeset
|
86 |
8583
537bbbd4e987
commit https://github.com/vim/vim/commit/65639032bb7b17996cd255d1508a1df4ad528a1f
Christian Brabandt <cb@256bit.org>
parents:
8581
diff
changeset
|
87 let dict = {"tr": function('tr', ['hello', 'h', 'H'])} |
537bbbd4e987
commit https://github.com/vim/vim/commit/65639032bb7b17996cd255d1508a1df4ad528a1f
Christian Brabandt <cb@256bit.org>
parents:
8581
diff
changeset
|
88 call assert_equal("Hello", dict.tr()) |
19783
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
89 |
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
90 call assert_fails("let F=function('setloclist', 10)", "E923:") |
29994
86eb4aba16c3
patch 9.0.0335: checks for Dictionary argument often give a vague error
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
91 call assert_fails("let F=function('setloclist', [], [])", "E1206:") |
8538
c337c813c64d
commit https://github.com/vim/vim/commit/1735bc988c546cc962c5f94792815b4d7cb79710
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 endfunc |
8575
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
93 |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
94 func Test_partial_implicit() |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
95 let dict = {'name': 'foo'} |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
96 func dict.MyFunc(arg) dict |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
97 return self.name . '/' . a:arg |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
98 endfunc |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
99 |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
100 call assert_equal('foo/bar', dict.MyFunc('bar')) |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
101 |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
102 call assert_fails('let func = dict.MyFunc', 'E704:') |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
103 let Func = dict.MyFunc |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
104 call assert_equal('foo/aaa', Func('aaa')) |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
105 |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
106 let Func = function(dict.MyFunc, ['bbb']) |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
107 call assert_equal('foo/bbb', Func()) |
b5209a4e5baf
commit https://github.com/vim/vim/commit/ab1fa3955f25dfdb7e329c3bd76e175c93c8cb5e
Christian Brabandt <cb@256bit.org>
parents:
8548
diff
changeset
|
108 endfunc |
8581
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
109 |
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
110 fun InnerCall(funcref) |
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
111 return a:funcref |
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
112 endfu |
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
113 |
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
114 fun OuterCall() |
19249
2a017e9dc6da
patch 8.2.0183: tests fail when the float feature is disabled
Bram Moolenaar <Bram@vim.org>
parents:
17534
diff
changeset
|
115 let opt = { 'func' : function('max') } |
8581
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
116 call InnerCall(opt.func) |
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
117 endfu |
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
118 |
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
119 func Test_function_in_dict() |
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
120 call OuterCall() |
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
121 endfunc |
fd454847836d
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Christian Brabandt <cb@256bit.org>
parents:
8575
diff
changeset
|
122 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
9846
diff
changeset
|
123 func s:cache_clear() dict |
8585
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
124 return self.name |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
9846
diff
changeset
|
125 endfunc |
8585
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
126 |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
127 func Test_script_function_in_dict() |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
128 let s:obj = {'name': 'foo'} |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
129 let s:obj2 = {'name': 'bar'} |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
130 |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
131 let s:obj['clear'] = function('s:cache_clear') |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
132 |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
133 call assert_equal('foo', s:obj.clear()) |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
134 let F = s:obj.clear |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
135 call assert_equal('foo', F()) |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
136 call assert_equal('foo', call(s:obj.clear, [], s:obj)) |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
137 call assert_equal('bar', call(s:obj.clear, [], s:obj2)) |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
138 |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
139 let s:obj2['clear'] = function('s:cache_clear') |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
140 call assert_equal('bar', s:obj2.clear()) |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
141 let B = s:obj2.clear |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
142 call assert_equal('bar', B()) |
ce37bbedcb65
commit https://github.com/vim/vim/commit/6f2e4b36c9d9908e1cace2b1b96e2c154a837bc2
Christian Brabandt <cb@256bit.org>
parents:
8583
diff
changeset
|
143 endfunc |
8591
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
144 |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
9846
diff
changeset
|
145 func s:cache_arg(arg) dict |
8599
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
146 let s:result = self.name . '/' . a:arg |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
147 return s:result |
15406
63b02fcf1361
patch 8.1.0711: test files still use function!
Bram Moolenaar <Bram@vim.org>
parents:
9846
diff
changeset
|
148 endfunc |
8599
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
149 |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
150 func Test_script_function_in_dict_arg() |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
151 let s:obj = {'name': 'foo'} |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
152 let s:obj['clear'] = function('s:cache_arg') |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
153 |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
154 call assert_equal('foo/bar', s:obj.clear('bar')) |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
155 let F = s:obj.clear |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
156 let s:result = '' |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
157 call assert_equal('foo/bar', F('bar')) |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
158 call assert_equal('foo/bar', s:result) |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
159 |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
160 let s:obj['clear'] = function('s:cache_arg', ['bar']) |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
161 call assert_equal('foo/bar', s:obj.clear()) |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
162 let s:result = '' |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
163 call s:obj.clear() |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
164 call assert_equal('foo/bar', s:result) |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
165 |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
166 let F = s:obj.clear |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
167 call assert_equal('foo/bar', F()) |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
168 let s:result = '' |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
169 call F() |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
170 call assert_equal('foo/bar', s:result) |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
171 |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
172 call assert_equal('foo/bar', call(s:obj.clear, [], s:obj)) |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
173 endfunc |
ddb04cbe1e0c
commit https://github.com/vim/vim/commit/9e63f61cb01c70fd71652f54b2d01ee27b2a3534
Christian Brabandt <cb@256bit.org>
parents:
8593
diff
changeset
|
174 |
8591
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
175 func Test_partial_exists() |
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
176 let F = function('MyFunc') |
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
177 call assert_true(exists('*F')) |
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
178 let lF = [F] |
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
179 call assert_true(exists('*lF[0]')) |
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
180 |
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
181 let F = function('MyFunc', ['arg']) |
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
182 call assert_true(exists('*F')) |
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
183 let lF = [F] |
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
184 call assert_true(exists('*lF[0]')) |
5bc958a92849
commit https://github.com/vim/vim/commit/d22a18928ebcb465393da1418bb88204b97badb1
Christian Brabandt <cb@256bit.org>
parents:
8585
diff
changeset
|
185 endfunc |
8637
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
186 |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
187 func Test_partial_string() |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
188 let F = function('MyFunc') |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
189 call assert_equal("function('MyFunc')", string(F)) |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
190 let F = function('MyFunc', ['foo']) |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
191 call assert_equal("function('MyFunc', ['foo'])", string(F)) |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
192 let F = function('MyFunc', ['foo', 'bar']) |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
193 call assert_equal("function('MyFunc', ['foo', 'bar'])", string(F)) |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
194 let d = {'one': 1} |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
195 let F = function('MyFunc', d) |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
196 call assert_equal("function('MyFunc', {'one': 1})", string(F)) |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
197 let F = function('MyFunc', ['foo'], d) |
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
198 call assert_equal("function('MyFunc', ['foo'], {'one': 1})", string(F)) |
20158
94f05de75e9f
patch 8.2.0634: crash with null partial and blob
Bram Moolenaar <Bram@vim.org>
parents:
20156
diff
changeset
|
199 call assert_equal("function('')", string(test_null_function())) |
94f05de75e9f
patch 8.2.0634: crash with null partial and blob
Bram Moolenaar <Bram@vim.org>
parents:
20156
diff
changeset
|
200 call assert_equal("function('')", string(test_null_partial())) |
8637
ff41ece2e4b8
commit https://github.com/vim/vim/commit/5c29154b521e9948190be653cfda666ecbb63b5b
Christian Brabandt <cb@256bit.org>
parents:
8599
diff
changeset
|
201 endfunc |
8698
13b0ed12a78a
commit https://github.com/vim/vim/commit/e4eb6ff089e79e659acf33c17dd0fda7177de526
Christian Brabandt <cb@256bit.org>
parents:
8637
diff
changeset
|
202 |
13b0ed12a78a
commit https://github.com/vim/vim/commit/e4eb6ff089e79e659acf33c17dd0fda7177de526
Christian Brabandt <cb@256bit.org>
parents:
8637
diff
changeset
|
203 func Test_func_unref() |
13b0ed12a78a
commit https://github.com/vim/vim/commit/e4eb6ff089e79e659acf33c17dd0fda7177de526
Christian Brabandt <cb@256bit.org>
parents:
8637
diff
changeset
|
204 let obj = {} |
13b0ed12a78a
commit https://github.com/vim/vim/commit/e4eb6ff089e79e659acf33c17dd0fda7177de526
Christian Brabandt <cb@256bit.org>
parents:
8637
diff
changeset
|
205 function! obj.func() abort |
13b0ed12a78a
commit https://github.com/vim/vim/commit/e4eb6ff089e79e659acf33c17dd0fda7177de526
Christian Brabandt <cb@256bit.org>
parents:
8637
diff
changeset
|
206 endfunction |
13b0ed12a78a
commit https://github.com/vim/vim/commit/e4eb6ff089e79e659acf33c17dd0fda7177de526
Christian Brabandt <cb@256bit.org>
parents:
8637
diff
changeset
|
207 let funcnumber = matchstr(string(obj.func), '^function(''\zs.\{-}\ze''') |
13b0ed12a78a
commit https://github.com/vim/vim/commit/e4eb6ff089e79e659acf33c17dd0fda7177de526
Christian Brabandt <cb@256bit.org>
parents:
8637
diff
changeset
|
208 call assert_true(exists('*{' . funcnumber . '}')) |
13b0ed12a78a
commit https://github.com/vim/vim/commit/e4eb6ff089e79e659acf33c17dd0fda7177de526
Christian Brabandt <cb@256bit.org>
parents:
8637
diff
changeset
|
209 unlet obj |
13b0ed12a78a
commit https://github.com/vim/vim/commit/e4eb6ff089e79e659acf33c17dd0fda7177de526
Christian Brabandt <cb@256bit.org>
parents:
8637
diff
changeset
|
210 call assert_false(exists('*{' . funcnumber . '}')) |
13b0ed12a78a
commit https://github.com/vim/vim/commit/e4eb6ff089e79e659acf33c17dd0fda7177de526
Christian Brabandt <cb@256bit.org>
parents:
8637
diff
changeset
|
211 endfunc |
8710
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
212 |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
213 func Test_tostring() |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
214 let d = {} |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
215 let d.d = d |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
216 function d.test3() |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
217 echo 42 |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
218 endfunction |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
219 try |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
220 call string(d.test3) |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
221 catch |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
222 call assert_true(v:false, v:exception) |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
223 endtry |
af3cb5c068fd
commit https://github.com/vim/vim/commit/24c77a1e3a2ad510582116229462b482d69b4b8e
Christian Brabandt <cb@256bit.org>
parents:
8698
diff
changeset
|
224 endfunc |
8712
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
225 |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
226 func Test_redefine_dict_func() |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
227 let d = {} |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
228 function d.test4() |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
229 endfunction |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
230 let d.test4 = d.test4 |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
231 try |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
232 function! d.test4(name) |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
233 endfunction |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
234 catch |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
235 call assert_true(v:errmsg, v:exception) |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
236 endtry |
65130a9d3386
commit https://github.com/vim/vim/commit/c5fbe8af4cd80789f831b78aa44ff0b238138769
Christian Brabandt <cb@256bit.org>
parents:
8710
diff
changeset
|
237 endfunc |
8714
a5224eeb3546
commit https://github.com/vim/vim/commit/4c90861e9f864eab94f043c432acff508396ed62
Christian Brabandt <cb@256bit.org>
parents:
8712
diff
changeset
|
238 |
a5224eeb3546
commit https://github.com/vim/vim/commit/4c90861e9f864eab94f043c432acff508396ed62
Christian Brabandt <cb@256bit.org>
parents:
8712
diff
changeset
|
239 func Test_bind_in_python() |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
240 CheckFeature python |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
241 let g:d = {} |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
242 function g:d.test2() |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
243 endfunction |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
244 python import vim |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
245 try |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
246 call assert_equal(pyeval('vim.bindeval("g:d.test2")'), g:d.test2) |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
247 catch |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
248 call assert_true(v:false, v:exception) |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
249 endtry |
8714
a5224eeb3546
commit https://github.com/vim/vim/commit/4c90861e9f864eab94f043c432acff508396ed62
Christian Brabandt <cb@256bit.org>
parents:
8712
diff
changeset
|
250 endfunc |
8855
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
251 |
8863
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8855
diff
changeset
|
252 " This caused double free on exit if EXITFREE is defined. |
8855
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
253 func Test_cyclic_list_arg() |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
254 let l = [] |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
255 let Pt = function('string', [l]) |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
256 call add(l, Pt) |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
257 unlet l |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
258 unlet Pt |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
259 endfunc |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
260 |
8863
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8855
diff
changeset
|
261 " This caused double free on exit if EXITFREE is defined. |
8855
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
262 func Test_cyclic_dict_arg() |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
263 let d = {} |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
264 let Pt = function('string', [d]) |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
265 let d.Pt = Pt |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
266 unlet d |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
267 unlet Pt |
b76195a1e38e
commit https://github.com/vim/vim/commit/ddecc25947dbdd689d5bcaed32f298a08abdd497
Christian Brabandt <cb@256bit.org>
parents:
8714
diff
changeset
|
268 endfunc |
8863
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8855
diff
changeset
|
269 |
9846
95ad2692dec0
commit https://github.com/vim/vim/commit/0e5d3a2940ead6c8ee3bacacea4153b647b67cca
Christian Brabandt <cb@256bit.org>
parents:
9764
diff
changeset
|
270 func Ignored3(job1, job2, status) |
8863
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8855
diff
changeset
|
271 endfunc |
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8855
diff
changeset
|
272 |
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8855
diff
changeset
|
273 func Test_cycle_partial_job() |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
274 CheckFeature job |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
275 let job = job_start('echo') |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
276 call job_setoptions(job, {'exit_cb': function('Ignored3', [job])}) |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
277 unlet job |
8863
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8855
diff
changeset
|
278 endfunc |
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8855
diff
changeset
|
279 |
9846
95ad2692dec0
commit https://github.com/vim/vim/commit/0e5d3a2940ead6c8ee3bacacea4153b647b67cca
Christian Brabandt <cb@256bit.org>
parents:
9764
diff
changeset
|
280 func Ignored2(job, status) |
95ad2692dec0
commit https://github.com/vim/vim/commit/0e5d3a2940ead6c8ee3bacacea4153b647b67cca
Christian Brabandt <cb@256bit.org>
parents:
9764
diff
changeset
|
281 endfunc |
95ad2692dec0
commit https://github.com/vim/vim/commit/0e5d3a2940ead6c8ee3bacacea4153b647b67cca
Christian Brabandt <cb@256bit.org>
parents:
9764
diff
changeset
|
282 |
8863
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8855
diff
changeset
|
283 func Test_ref_job_partial_dict() |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
284 CheckFeature job |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
285 let g:ref_job = job_start('echo') |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
286 let d = {'a': 'b'} |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
287 call job_setoptions(g:ref_job, {'exit_cb': function('Ignored2', [], d)}) |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
20158
diff
changeset
|
288 call test_garbagecollect_now() |
8863
e1b84109506a
commit https://github.com/vim/vim/commit/107e1eef1df3b786ad3ad49fbdb9e058649303b5
Christian Brabandt <cb@256bit.org>
parents:
8855
diff
changeset
|
289 endfunc |
9104
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
290 |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
291 func Test_auto_partial_rebind() |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
292 let dict1 = {'name': 'dict1'} |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
293 func! dict1.f1() |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
294 return self.name |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
295 endfunc |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
296 let dict1.f2 = function(dict1.f1, dict1) |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
297 |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
298 call assert_equal('dict1', dict1.f1()) |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
299 call assert_equal('dict1', dict1['f1']()) |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
300 call assert_equal('dict1', dict1.f2()) |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
301 call assert_equal('dict1', dict1['f2']()) |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
302 |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
303 let dict2 = {'name': 'dict2'} |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
304 let dict2.f1 = dict1.f1 |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
305 let dict2.f2 = dict1.f2 |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
306 |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
307 call assert_equal('dict2', dict2.f1()) |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
308 call assert_equal('dict2', dict2['f1']()) |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
309 call assert_equal('dict1', dict2.f2()) |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
310 call assert_equal('dict1', dict2['f2']()) |
2242a5766417
commit https://github.com/vim/vim/commit/1d429610bf9e99a6252be8abbc910d6667e4d1da
Christian Brabandt <cb@256bit.org>
parents:
8865
diff
changeset
|
311 endfunc |
9110
6d3888e2232c
commit https://github.com/vim/vim/commit/2bbf8eff6fab16d86e7bcfc0da1962d31bec7891
Christian Brabandt <cb@256bit.org>
parents:
9104
diff
changeset
|
312 |
6d3888e2232c
commit https://github.com/vim/vim/commit/2bbf8eff6fab16d86e7bcfc0da1962d31bec7891
Christian Brabandt <cb@256bit.org>
parents:
9104
diff
changeset
|
313 func Test_get_partial_items() |
6d3888e2232c
commit https://github.com/vim/vim/commit/2bbf8eff6fab16d86e7bcfc0da1962d31bec7891
Christian Brabandt <cb@256bit.org>
parents:
9104
diff
changeset
|
314 let dict = {'name': 'hello'} |
9117
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
315 let args = ["foo", "bar"] |
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
316 let Func = function('MyDictFunc') |
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
317 let Cb = function('MyDictFunc', args, dict) |
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
318 |
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
319 call assert_equal(Func, get(Cb, 'func')) |
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
320 call assert_equal('MyDictFunc', get(Cb, 'name')) |
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
321 call assert_equal(args, get(Cb, 'args')) |
9110
6d3888e2232c
commit https://github.com/vim/vim/commit/2bbf8eff6fab16d86e7bcfc0da1962d31bec7891
Christian Brabandt <cb@256bit.org>
parents:
9104
diff
changeset
|
322 call assert_equal(dict, get(Cb, 'dict')) |
6d3888e2232c
commit https://github.com/vim/vim/commit/2bbf8eff6fab16d86e7bcfc0da1962d31bec7891
Christian Brabandt <cb@256bit.org>
parents:
9104
diff
changeset
|
323 call assert_fails('call get(Cb, "xxx")', 'E475:') |
9117
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
324 |
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
325 call assert_equal(Func, get(Func, 'func')) |
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
326 call assert_equal('MyDictFunc', get(Func, 'name')) |
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
327 call assert_equal([], get(Func, 'args')) |
0cc48b3cd884
commit https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Christian Brabandt <cb@256bit.org>
parents:
9110
diff
changeset
|
328 call assert_true(empty( get(Func, 'dict'))) |
17534
2b4c138bf8e9
patch 8.1.1765: get(func, dict, def) does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
329 |
2b4c138bf8e9
patch 8.1.1765: get(func, dict, def) does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
330 let P = function('substitute', ['hello there', 'there']) |
2b4c138bf8e9
patch 8.1.1765: get(func, dict, def) does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
331 let dict = {'partial has': 'no dict'} |
2b4c138bf8e9
patch 8.1.1765: get(func, dict, def) does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
332 call assert_equal(dict, get(P, 'dict', dict)) |
2b4c138bf8e9
patch 8.1.1765: get(func, dict, def) does not work properly
Bram Moolenaar <Bram@vim.org>
parents:
15406
diff
changeset
|
333 call assert_equal(0, get(l:P, 'dict')) |
9110
6d3888e2232c
commit https://github.com/vim/vim/commit/2bbf8eff6fab16d86e7bcfc0da1962d31bec7891
Christian Brabandt <cb@256bit.org>
parents:
9104
diff
changeset
|
334 endfunc |
9183
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
335 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
336 func Test_compare_partials() |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
337 let d1 = {} |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
338 let d2 = {} |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
339 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
340 function d1.f1() dict |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
341 endfunction |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
342 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
343 function d1.f2() dict |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
344 endfunction |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
345 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
346 let F1 = get(d1, 'f1') |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
347 let F2 = get(d1, 'f2') |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
348 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
349 let F1d1 = function(F1, d1) |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
350 let F2d1 = function(F2, d2) |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
351 let F1d1a1 = function(F1d1, [1]) |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
352 let F1d1a12 = function(F1d1, [1, 2]) |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
353 let F1a1 = function(F1, [1]) |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
354 let F1a2 = function(F1, [2]) |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
355 let F1d2 = function(F1, d2) |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
356 let d3 = {'f1': F1, 'f2': F2} |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
357 let F1d3 = function(F1, d3) |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
358 let F1ad1 = function(F1, [d1]) |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
359 let F1ad3 = function(F1, [d3]) |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
360 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
361 call assert_match('^function(''\d\+'')$', string(F1)) " Not a partial |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
362 call assert_match('^function(''\d\+'')$', string(F2)) " Not a partial |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
363 call assert_match('^function(''\d\+'', {.*})$', string(F1d1)) " A partial |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
364 call assert_match('^function(''\d\+'', {.*})$', string(F2d1)) " A partial |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
365 call assert_match('^function(''\d\+'', \[.*\])$', string(F1a1)) " No dict |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
366 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
367 " != |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
368 let X = F1 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
369 call assert_false(F1 != X) " same function |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
370 let X = F1d1 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
371 call assert_false(F1d1 != X) " same partial |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
372 let X = F1d1a1 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
373 call assert_false(F1d1a1 != X) " same partial |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
374 let X = F1a1 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
375 call assert_false(F1a1 != X) " same partial |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
376 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
377 call assert_true(F1 != F2) " Different functions |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
378 call assert_true(F1 != F1d1) " Partial /= non-partial |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
379 call assert_true(F1d1a1 != F1d1a12) " Different number of arguments |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
380 call assert_true(F1a1 != F1d1a12) " One has no dict |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
381 call assert_true(F1a1 != F1a2) " Different arguments |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
382 call assert_true(F1d2 != F1d1) " Different dictionaries |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
383 call assert_false(F1d1 != F1d3) " Equal dictionaries, even though d1 isnot d3 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
384 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
385 " isnot, option 1 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
386 call assert_true(F1 isnot# F2) " Different functions |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
387 call assert_true(F1 isnot# F1d1) " Partial /= non-partial |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
388 call assert_true(F1d1 isnot# F1d3) " d1 isnot d3, even though d1 == d3 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
389 call assert_true(F1a1 isnot# F1d1a12) " One has no dict |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
390 call assert_true(F1a1 isnot# F1a2) " Different number of arguments |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
391 call assert_true(F1ad1 isnot# F1ad3) " In arguments d1 isnot d3 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
392 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
393 " isnot, option 2 |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
394 call assert_true(F1 isnot# F2) " Different functions |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
395 call assert_true(F1 isnot# F1d1) " Partial /= non-partial |
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
396 call assert_true(d1.f1 isnot# d1.f1) " handle_subscript creates new partial each time |
20156
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
397 |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
398 " compare two null partials |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
399 let N1 = test_null_partial() |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
400 let N2 = N1 |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
401 call assert_true(N1 is N2) |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
402 call assert_true(N1 == N2) |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
403 |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
404 " compare a partial and a null partial |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
405 call assert_false(N1 == F1) |
49694eceaa55
patch 8.2.0633: crash when using null partial in filter()
Bram Moolenaar <Bram@vim.org>
parents:
19783
diff
changeset
|
406 call assert_false(F1 is N1) |
9183
988c8ab557bf
commit https://github.com/vim/vim/commit/8e759ba8651428995b338b66c615367259f79766
Christian Brabandt <cb@256bit.org>
parents:
9145
diff
changeset
|
407 endfunc |
19783
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
408 |
546bdeef35f1
patch 8.2.0448: various functions not properly tested
Bram Moolenaar <Bram@vim.org>
parents:
19249
diff
changeset
|
409 " vim: shiftwidth=2 sts=2 expandtab |