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 |