diff options
author | KunMing Xie <qqzz014@gmail.com> | 2017-09-10 18:52:43 +0800 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2017-09-10 12:52:43 +0200 |
commit | ceade2fe53175555c44fdc4b65530f18aeb17591 (patch) | |
tree | 57aa743ee0a05c9cc4deeee284a96c23c85bb6b0 /src | |
parent | 713a957e9c90fc1c57935e33346347807595f946 (diff) | |
download | rneovim-ceade2fe53175555c44fdc4b65530f18aeb17591.tar.gz rneovim-ceade2fe53175555c44fdc4b65530f18aeb17591.tar.bz2 rneovim-ceade2fe53175555c44fdc4b65530f18aeb17591.zip |
vim-patch:8.0.0186 (#7154)
Problem: The error message from assert_notequal() is confusing.
Solution: Only mention the expected value.
https://github.com/vim/vim/commit/5869cf060e60cc09e71b2b3bd85f0576ec78f9f5
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/eval.c | 24 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 14 insertions, 12 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d6ee13857a..5ee91d417a 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6747,6 +6747,8 @@ static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv, } else { if (atype == ASSERT_MATCH || atype == ASSERT_NOTMATCH) { ga_concat(gap, (char_u *)"Pattern "); + } else if (atype == ASSERT_NOTEQUAL) { + ga_concat(gap, (char_u *)"Expected not equal to "); } else { ga_concat(gap, (char_u *)"Expected "); } @@ -6757,18 +6759,18 @@ static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv, } else { ga_concat(gap, exp_str); } - tofree = (char_u *)encode_tv2string(got_tv, NULL); - if (atype == ASSERT_MATCH) { - ga_concat(gap, (char_u *)" does not match "); - } else if (atype == ASSERT_NOTMATCH) { - ga_concat(gap, (char_u *)" does match "); - } else if (atype == ASSERT_NOTEQUAL) { - ga_concat(gap, (char_u *)" differs from "); - } else { - ga_concat(gap, (char_u *)" but got "); + if (atype != ASSERT_NOTEQUAL) { + if (atype == ASSERT_MATCH) { + ga_concat(gap, (char_u *)" does not match "); + } else if (atype == ASSERT_NOTMATCH) { + ga_concat(gap, (char_u *)" does match "); + } else { + ga_concat(gap, (char_u *)" but got "); + } + tofree = (char_u *)encode_tv2string(got_tv, NULL); + ga_concat(gap, tofree); + xfree(tofree); } - ga_concat(gap, tofree); - xfree(tofree); } } diff --git a/src/nvim/version.c b/src/nvim/version.c index e7061fff9d..4c0071f248 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -766,7 +766,7 @@ static const int included_patches[] = { // 189, 188, // 187 NA - // 186, + 186, // 185, // 184, // 183, |