Skip to content

fix: Now, setting encode_escape_forward_slash on a cjson instance does not affect other instances.#125

Open
SnowOnion wants to merge 1 commit into
openresty:masterfrom
SnowOnion:fix-encode_escape_forward_slash
Open

fix: Now, setting encode_escape_forward_slash on a cjson instance does not affect other instances.#125
SnowOnion wants to merge 1 commit into
openresty:masterfrom
SnowOnion:fix-encode_escape_forward_slash

Conversation

@SnowOnion

Copy link
Copy Markdown

The new test case "Set encode_escape_forward_slash on a cjson instance should not affect other instances" passes with the fix, and fails without the fix.

@SnowOnion

Copy link
Copy Markdown
Author

🟢New function code + new test:

➜  tests git:(fix-encode_escape_forward_slash) ✗ pwd
/root/develop/github.com/openresty/lua-cjson/tests

➜  tests git:(fix-encode_escape_forward_slash) ✗ LUA_CPATH="../?.so;;" LUA_PATH="../lua/?.lua;;" luajit ./test.lua
...
==> Test [129] Set encode_escape_forward_slash on a cjson instance should not affect other instances: PASS
[Input] {  }
[Received:success] { "\"\\/\"", "\"/\"", "\"\\/\"" }

🔴Old function code + new test:

➜  tests git:(master) ✗ LUA_CPATH="../?.so;;" LUA_PATH="../lua/?.lua;;" luajit ./test.lua
...
==> Test [129] Set encode_escape_forward_slash on a cjson instance should not affect other instances: FAIL
[Input] {  }
[Expected:success] { "\"\\/\"", "\"/\"", "\"\\/\"" }
[Received:success] { "\"\\/\"", "\"/\"", "\"/\"" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants