You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test "Set encode_keep_buffer(nil, true)" fails on Lua 5.5 #98
==> Test [118] Set encode_keep_buffer(nil, true) [throw error]: FAIL
[Input] { nil, true }
[Expected:error] { ONE_OF{ "bad argument #2 to '?' (found too many arguments)", "bad argument #2 to 'cjson.encode_keep_buffer' (found too many arguments)" } }
[Received:success] { true }
On Lua 5.5, unpacking { nil, true } doesn't yield nil, true like previous Lua versions, causing encode_keep_buffer() is called with no argument, thus succeeds unexpectedly.
This should be an expected behavior, per the specification for the table library,
Remember that, whenever an operation needs the length of a table, all caveats about the length operator apply (see §3.4.7).
Activity