blob: f5c9e26c0c216b1f5bea342faf90ffe3e1f4466f [file] [log] [blame]
Bram Moolenaarf0e86a02016-03-19 19:38:12 +01001" Tests for expressions.
2
3func 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')
23endfunc
Bram Moolenaar819821c2016-03-26 21:24:14 +010024
25func Test_version()
26 call assert_true(has('patch-7.4.001'))
27 call assert_true(has('patch-7.4.01'))
28 call assert_true(has('patch-7.4.1'))
29 call assert_true(has('patch-6.9.999'))
30 call assert_true(has('patch-7.1.999'))
31 call assert_true(has('patch-7.4.123'))
32
33 call assert_false(has('patch-7'))
34 call assert_false(has('patch-7.4'))
35 call assert_false(has('patch-7.4.'))
36 call assert_false(has('patch-9.1.0'))
37 call assert_false(has('patch-9.9.1'))
38endfunc