aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-05 12:59:43 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-05-05 19:43:16 +0800
commitc11417b3d74f02568e37ea3370a7c24141d4f18a (patch)
treee1f359d22125f4b6c046d66b2595a70db7989ef2 /test
parent49c3eb01ab53c4f6bb3f372590878d46ef0c163a (diff)
downloadrneovim-c11417b3d74f02568e37ea3370a7c24141d4f18a.tar.gz
rneovim-c11417b3d74f02568e37ea3370a7c24141d4f18a.tar.bz2
rneovim-c11417b3d74f02568e37ea3370a7c24141d4f18a.zip
vim-patch:9.0.1507: assert message is confusing with boolean result
Problem: Assert message is confusing with boolean result. assert_inrange() replaces message instead of adding it. Solution: Don't put quotes around expected boolean value. Append message for assert_inrange(). (closes vim/vim#12342, closes vim/vim#12341) https://github.com/vim/vim/commit/53f5e51628b56ef9171671cd6e9970374036a084 Move assert_type_T to testing.c and remove ASSERT_INRANGE.
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_assert.vim13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/old/testdir/test_assert.vim b/test/old/testdir/test_assert.vim
index 087eea3bcf..57d11d0e3a 100644
--- a/test/old/testdir/test_assert.vim
+++ b/test/old/testdir/test_assert.vim
@@ -9,11 +9,11 @@ func Test_assert_false()
call assert_equal(0, v:false->assert_false())
call assert_equal(1, assert_false(123))
- call assert_match("Expected 'False' but got 123", v:errors[0])
+ call assert_match("Expected False but got 123", v:errors[0])
call remove(v:errors, 0)
call assert_equal(1, 123->assert_false())
- call assert_match("Expected 'False' but got 123", v:errors[0])
+ call assert_match("Expected False but got 123", v:errors[0])
call remove(v:errors, 0)
endfunc
@@ -24,11 +24,11 @@ func Test_assert_true()
call assert_equal(0, v:true->assert_true())
call assert_equal(1, assert_true(0))
- call assert_match("Expected 'True' but got 0", v:errors[0])
+ call assert_match("Expected True but got 0", v:errors[0])
call remove(v:errors, 0)
call assert_equal(1, 0->assert_true())
- call assert_match("Expected 'True' but got 0", v:errors[0])
+ call assert_match("Expected True but got 0", v:errors[0])
call remove(v:errors, 0)
endfunc
@@ -405,8 +405,11 @@ func Test_assert_inrange()
call remove(v:errors, 0)
" Use a custom message
+ call assert_equal(1, assert_inrange(5, 7, 8, "Higher"))
+ call assert_match("Higher: Expected range 5 - 7, but got 8", v:errors[0])
+ call remove(v:errors, 0)
call assert_equal(1, assert_inrange(5, 7, 8.0, "Higher"))
- call assert_match("Higher", v:errors[0])
+ call assert_match("Higher: Expected range 5.0 - 7.0, but got 8.0", v:errors[0])
call remove(v:errors, 0)
" Invalid arguments