diff --git a/assert.lua b/assert.lua index 8cfccb0..d318b1c 100644 --- a/assert.lua +++ b/assert.lua @@ -90,9 +90,14 @@ function assert:one_of(a, t, msg, stack_level) end end + local values = {} + for index = 1, #t do + values[index] = tostring(t[index]) + end + error(("assertion failed: %s not one of %s %s"):format( tostring(a), - table.concat(t, ", "), + table.concat(values, ", "), _extra(msg) ), 2 + (stack_level or 0)) end