aboutsummaryrefslogtreecommitdiff
path: root/test/assert.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2026-06-23 18:30:23 +0800
committerGitHub <noreply@github.com>2026-06-23 18:30:23 +0800
commitceaf2baa608993b6103796c274d09c77824887f8 (patch)
treec049c61b5372521c6f8eff870eb0adac5535ba88 /test/assert.lua
parentdb30608058db402de37be7a1d33fa60b7fc7de83 (diff)
downloadrneovim-ceaf2baa608993b6103796c274d09c77824887f8.tar.gz
rneovim-ceaf2baa608993b6103796c274d09c77824887f8.tar.bz2
rneovim-ceaf2baa608993b6103796c274d09c77824887f8.zip
test: fix confusing behavior of eq() with context (#40375)
Diffstat (limited to 'test/assert.lua')
-rw-r--r--test/assert.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/test/assert.lua b/test/assert.lua
index 47eb2e4c85..4ec1c610ae 100644
--- a/test/assert.lua
+++ b/test/assert.lua
@@ -21,11 +21,10 @@ end
--- @param condition boolean
--- @param value any
--- @param context any
---- @param fallback string
-local function assert_value(condition, value, context, fallback)
+--- @param message string
+local function assert_value(condition, value, context, message)
if not condition then
- local message = context ~= nil and tostring(context) or fallback
- error(message, 0)
+ error((context ~= nil and tostring(context) .. ': ' or '') .. message, 0)
end
return value
end