Bram Moolenaar | f0e86a0 | 2016-03-19 19:38:12 +0100 | [diff] [blame] | 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 |
Bram Moolenaar | 819821c | 2016-03-26 21:24:14 +0100 | [diff] [blame] | 24 | |
| 25 | func 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')) |
| 38 | endfunc |