diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/agentzh.t | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/agentzh.t b/tests/agentzh.t index 7967337..7591902 100644 --- a/tests/agentzh.t +++ b/tests/agentzh.t | |||
@@ -284,3 +284,22 @@ print(string.format("%16.0f", cjson.decode("9007199254740992"))) | |||
284 | 9.007199254741e+15 | 284 | 9.007199254741e+15 |
285 | 9007199254740992 | 285 | 9007199254740992 |
286 | 9007199254740992 | 286 | 9007199254740992 |
287 | |||
288 | |||
289 | |||
290 | === TEST 21: / in string | ||
291 | --- lua | ||
292 | local cjson = require "cjson" | ||
293 | local a={test = "http://google.com/google"} | ||
294 | local b=cjson.encode(a) | ||
295 | print(b) | ||
296 | cjson.encode_escape_forward_slash(false) | ||
297 | local b=cjson.encode(a) | ||
298 | print(b) | ||
299 | cjson.encode_escape_forward_slash(true) | ||
300 | local b=cjson.encode(a) | ||
301 | print(b) | ||
302 | --- out | ||
303 | {"test":"http:\/\/google.com\/google"} | ||
304 | {"test":"http://google.com/google"} | ||
305 | {"test":"http:\/\/google.com\/google"} | ||