diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2020-12-01 22:30:05 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2020-12-01 22:30:05 +0000 |
| commit | f10585d7f2b1d2f516e13239582da09d7b402aae (patch) | |
| tree | 18be65666d0b9553ff5825dd3703d30be50b12ac /dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-sparse_array_test_fix.patch | |
| parent | d73aef5c3ce87eefefa21c67596ebe0e81c7beaa (diff) | |
| download | baldeagleos-repo-f10585d7f2b1d2f516e13239582da09d7b402aae.tar.gz baldeagleos-repo-f10585d7f2b1d2f516e13239582da09d7b402aae.tar.xz baldeagleos-repo-f10585d7f2b1d2f516e13239582da09d7b402aae.zip | |
Updating liguros repo
Diffstat (limited to 'dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-sparse_array_test_fix.patch')
| -rw-r--r-- | dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-sparse_array_test_fix.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-sparse_array_test_fix.patch b/dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-sparse_array_test_fix.patch new file mode 100644 index 000000000000..e031672dae33 --- /dev/null +++ b/dev-lua/lua-cjson/files/lua-cjson-2.1.0.8-sparse_array_test_fix.patch @@ -0,0 +1,31 @@ +--- a/tests/test.lua ++++ b/tests/test.lua +@@ -10,6 +10,17 @@ + local json_safe = require "cjson.safe" + local util = require "cjson.util" + ++local function json_encode_output_type(value) ++ local text = json.encode(value) ++ if string.match(text, "{.*}") then ++ return "object" ++ elseif string.match(text, "%[.*%]") then ++ return "array" ++ else ++ return "scalar" ++ end ++end ++ + local function gen_raw_octets() + local chars = {} + for i = 0, 255 do chars[i + 1] = string.char(i) end +@@ -292,8 +303,8 @@ + json.encode, { { [1] = "one", [4] = "sparse test" } }, + true, { '["one",null,null,"sparse test"]' } }, + { "Encode sparse array as object", +- json.encode, { { [1] = "one", [5] = "sparse test" } }, +- true, { '{"5":"sparse test","1":"one"}' } }, ++ json_encode_output_type, { { [1] = "one", [5] = "sparse test" } }, ++ true, { 'object' } }, + { "Encode table with numeric string key as object", + json.encode, { { ["2"] = "numeric string key test" } }, + true, { '{"2":"numeric string key test"}' } }, |
