mirror of
https://github.com/lua/lua
synced 2025-03-23 22:22:51 +03:00
Bug: 'string.concat' error message uses wrong format
This commit is contained in:
parent
38cc7d40a4
commit
c03c527fd2
@ -146,7 +146,7 @@ static int tmove (lua_State *L) {
|
||||
static void addfield (lua_State *L, luaL_Buffer *b, lua_Integer i) {
|
||||
lua_geti(L, 1, i);
|
||||
if (!lua_isstring(L, -1))
|
||||
luaL_error(L, "invalid value (%s) at index %d in table for 'concat'",
|
||||
luaL_error(L, "invalid value (%s) at index %I in table for 'concat'",
|
||||
luaL_typename(L, -1), i);
|
||||
luaL_addvalue(b);
|
||||
}
|
||||
|
@ -361,6 +361,9 @@ assert(load("return 1\n--comment without ending EOL")() == 1)
|
||||
|
||||
|
||||
checkerror("table expected", table.concat, 3)
|
||||
checkerror("at index " .. maxi, table.concat, {}, " ", maxi, maxi)
|
||||
-- '%' escapes following minus signal
|
||||
checkerror("at index %" .. mini, table.concat, {}, " ", mini, mini)
|
||||
assert(table.concat{} == "")
|
||||
assert(table.concat({}, 'x') == "")
|
||||
assert(table.concat({'\0', '\0\1', '\0\1\2'}, '.\0.') == "\0.\0.\0\1.\0.\0\1\2")
|
||||
|
Loading…
x
Reference in New Issue
Block a user