Hi,

On Sat, 19 Aug 2017 04:55:23 +0000 daurnimator <q...@daurnimator.com> wrote:
> The lua-cjson package is missing a lua 5.3 version (it only contains 5.1 and
> 5.2)

I was working on implementing this. It needs a new symlink to
lua5.1.dh-lua.conf from debian/lua5.3.dh-lua.conf for dh-lua and some
adjustments for lua 5.3.

For example, at the top of lua/cjson/util.lua add:

    local unpack = unpack or table.unpack

Because unpack was moved to table.unpack. This way it's compatible with lua
5.1, 5.2 and 5.3.

Unfortunately, some testcases fail with lua 5.3 (see the end of this message)
but unfortunately this is the first time I'm touching Lua, so I'm unable to fix
these problems.

Thanks!

cheers, josch




==> Test [91] Set encode_number_precision(0) [throw error]: FAIL
[Input] { 0 }
[Expected:error] { "bad argument #1 to '?' (expected integer between 1 and 14)" 
}
[Received:error] { "bad argument #1 to 'cjson.encode_number_precision' 
(expected integer between 1 and 14)" }

==> Test [92] Set encode_number_precision("five") [throw error]: FAIL
[Input] { "five" }
[Expected:error] { "bad argument #1 to '?' (number expected, got string)" }
[Received:error] { "bad argument #1 to 'cjson.encode_number_precision' (number 
expected, got string)" }

==> Test [93] Set encode_keep_buffer(nil, true) [throw error]: FAIL
[Input] { nil, true }
[Expected:error] { "bad argument #2 to '?' (found too many arguments)" }
[Received:error] { "bad argument #2 to 'cjson.encode_keep_buffer' (found too 
many arguments)" }

==> Test [94] Set encode_max_depth("wrong") [throw error]: FAIL
[Input] { "wrong" }
[Expected:error] { "bad argument #1 to '?' (number expected, got string)" }
[Received:error] { "bad argument #1 to 'cjson.encode_max_depth' (number 
expected, got string)" }

==> Test [95] Set decode_max_depth(0) [throw error]: FAIL
[Input] { "0" }
[Expected:error] { "bad argument #1 to '?' (expected integer between 1 and 
2147483647)" }
[Received:error] { "bad argument #1 to 'cjson.decode_max_depth' (expected 
integer between 1 and 2147483647)" }

==> Test [96] Set encode_invalid_numbers(-2) [throw error]: FAIL
[Input] { -2 }
[Expected:error] { "bad argument #1 to '?' (invalid option '-2')" }
[Received:error] { "bad argument #1 to 'cjson.encode_invalid_numbers' (invalid 
option '-2')" }

==> Test [97] Set decode_invalid_numbers(true, false) [throw error]: FAIL
[Input] { true, false }
[Expected:error] { "bad argument #2 to '?' (found too many arguments)" }
[Received:error] { "bad argument #2 to 'cjson.decode_invalid_numbers' (found 
too many arguments)" }

==> Test [98] Set encode_sparse_array("not quite on") [throw error]: FAIL
[Input] { "not quite on" }
[Expected:error] { "bad argument #1 to '?' (invalid option 'not quite on')" }
[Received:error] { "bad argument #1 to 'cjson.encode_sparse_array' (invalid 
option 'not quite on')" }

==> Test [101] Encode (safe) argument validation [throw error]: FAIL
[Input] { "arg1", "arg2" }
[Expected:error] { "bad argument #1 to '?' (expected 1 argument)" }
[Received:error] { "bad argument #1 to 'cjson.safe.encode' (expected 1 
argument)" }


Attachment: signature.asc
Description: signature

Reply via email to