aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2025-01-15 20:49:07 +0100
committerFederico Angelilli <code@fedang.net>2025-01-15 20:49:07 +0100
commit944f6d5425c0e8dbb85e82f810b313434ae703a2 (patch)
tree96d870fb187a3632a2719f57e5a7e108103e83a1 /test
parentdf7832c999e48fcaf9d6815420b307a77b046868 (diff)
Implement string escape for any_json
Diffstat (limited to 'test')
-rw-r--r--test/json.c10
-rw-r--r--test/log.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/test/json.c b/test/json.c
index 635f474..e491c44 100644
--- a/test/json.c
+++ b/test/json.c
@@ -55,9 +55,9 @@ void test_write(bool pretty)
const char *props[][2] = {
{ "name", "test" },
- { "scope", "local" },
- { "project", "any_json" },
- { "author", "me" },
+ { "scope", "local \x1f" },
+ { "project", "any_json とてもクールで縮みません" },
+ { "author", "me \"trying\" hard" },
{ 0 },
};
@@ -82,10 +82,10 @@ void test_write(bool pretty)
any_json_write_open_array(&json);
{
any_json_write_member(&json, NULL);
- any_json_write_string(&json, "nested");
+ any_json_write_string(&json, "nested \\ \" /");
any_json_write_member(&json, NULL);
- any_json_write_string(&json, "array");
+ any_json_write_string(&json, "array \f \b \n \r \t o");
}
any_json_write_close_array(&json);
}
diff --git a/test/log.c b/test/log.c
index c3e0dd5..7f7d889 100644
--- a/test/log.c
+++ b/test/log.c
@@ -1,6 +1,6 @@
#include <stdbool.h>
-#define ANY_LOG_LOCKING
+//#define ANY_LOG_LOCKING
#define ANY_LOG_IMPLEMENT
#define ANY_LOG_MODULE "test"