Mercurial > vim
comparison src/testdir/test_vim9_expr.vim @ 19860:37c4779ca8f5 v8.2.0486
patch 8.2.0486: Vim9: some code and error messages not tested
Commit: https://github.com/vim/vim/commit/9be61bbb170ed3df0e408c8ac12516e772dc0b75
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Mar 30 22:51:24 2020 +0200
patch 8.2.0486: Vim9: some code and error messages not tested
Problem: Vim9: some code and error messages not tested.
Solution: Add more tests.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 30 Mar 2020 23:00:05 +0200 |
parents | 90eec641cc8c |
children | 8a7bede7b138 |
comparison
equal
deleted
inserted
replaced
19859:904b25746b64 | 19860:37c4779ca8f5 |
---|---|
56 assert_equal('two', var ? 'one' : 'two') | 56 assert_equal('two', var ? 'one' : 'two') |
57 enddef | 57 enddef |
58 | 58 |
59 func Test_expr1_fails() | 59 func Test_expr1_fails() |
60 call CheckDefFailure("let x = 1 ? 'one'", "Missing ':' after '?'") | 60 call CheckDefFailure("let x = 1 ? 'one'", "Missing ':' after '?'") |
61 call CheckDefFailure("let x = 1 ? 'one' : xxx", "E1001:") | |
61 | 62 |
62 let msg = "white space required before and after '?'" | 63 let msg = "white space required before and after '?'" |
63 call CheckDefFailure("let x = 1? 'one' : 'two'", msg) | 64 call CheckDefFailure("let x = 1? 'one' : 'two'", msg) |
64 call CheckDefFailure("let x = 1 ?'one' : 'two'", msg) | 65 call CheckDefFailure("let x = 1 ?'one' : 'two'", msg) |
65 call CheckDefFailure("let x = 1?'one' : 'two'", msg) | 66 call CheckDefFailure("let x = 1?'one' : 'two'", msg) |
190 assert_equal(true, 'abc' == 'abc') | 191 assert_equal(true, 'abc' == 'abc') |
191 assert_equal(false, 'xyz' == 'abc') | 192 assert_equal(false, 'xyz' == 'abc') |
192 assert_equal(true, g:astring == 'asdf') | 193 assert_equal(true, g:astring == 'asdf') |
193 assert_equal(false, 'xyz' == g:astring) | 194 assert_equal(false, 'xyz' == g:astring) |
194 | 195 |
196 assert_equal(false, 'abc' == 'aBc') | |
197 assert_equal(false, 'abc' ==# 'aBc') | |
198 assert_equal(true, 'abc' ==? 'aBc') | |
199 | |
195 assert_equal(false, 'abc' == 'ABC') | 200 assert_equal(false, 'abc' == 'ABC') |
196 set ignorecase | 201 set ignorecase |
197 assert_equal(false, 'abc' == 'ABC') | 202 assert_equal(false, 'abc' == 'ABC') |
203 assert_equal(false, 'abc' ==# 'ABC') | |
198 set noignorecase | 204 set noignorecase |
205 | |
206 call CheckDefFailure("let x = 'a' == xxx", 'E1001:') | |
199 | 207 |
200 assert_equal(true, 0z3f == 0z3f) | 208 assert_equal(true, 0z3f == 0z3f) |
201 assert_equal(false, 0z3f == 0z4f) | 209 assert_equal(false, 0z3f == 0z4f) |
202 assert_equal(true, g:ablob == 0z01ab) | 210 assert_equal(true, g:ablob == 0z01ab) |
203 assert_equal(false, 0z3f == g:ablob) | 211 assert_equal(false, 0z3f == g:ablob) |