Happy new year
[yaz-moved-to-github.git] / test / test_json.c
index eace27e..6b41046 100644 (file)
@@ -1,7 +1,15 @@
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2012 Index Data
+ * See the file LICENSE for details.
+ */
 /**
  * \file 
  * \brief JSON test
  */
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <yaz/test.h>
 #include <yaz/json.h>
 #include <string.h>
@@ -110,9 +118,24 @@ static void tst1(void)
 
     YAZ_CHECK(expect(p, "{\"a\":[1,2,3]}", "{\"a\":[1,2,3]}"));
 
-    YAZ_CHECK(expect(p, "{\"k\":\"\\t\"}", "{\"k\":\"\x09\"}"));
+    YAZ_CHECK(expect(p, "{\"k\":\"\\t\"}", "{\"k\":\"\\t\"}"));
+    YAZ_CHECK(expect(p, "{\"k\":\"\t\"}", "{\"k\":\"\\t\"}"));
+
+    YAZ_CHECK(expect(p, "{\"k\":\"\\n\"}", "{\"k\":\"\\n\"}"));
+    YAZ_CHECK(expect(p, "{\"k\":\"\n\"}", "{\"k\":\"\\n\"}"));
+
+    YAZ_CHECK(expect(p, "{\"k\":\"\\r\"}", "{\"k\":\"\\r\"}"));
+    YAZ_CHECK(expect(p, "{\"k\":\"\r\"}", "{\"k\":\"\\r\"}"));
+
+    YAZ_CHECK(expect(p, "{\"k\":\"\\f\"}", "{\"k\":\"\\f\"}"));
+    YAZ_CHECK(expect(p, "{\"k\":\"\f\"}", "{\"k\":\"\\f\"}"));
+
+    YAZ_CHECK(expect(p, "{\"k\":\"\\b\"}", "{\"k\":\"\\b\"}"));
+    YAZ_CHECK(expect(p, "{\"k\":\"\b\"}", "{\"k\":\"\\b\"}"));
 
-    YAZ_CHECK(expect(p, "{\"k\":\"\\u0009\"}", "{\"k\":\"\x09\"}"));
+    YAZ_CHECK(expect(p,
+                     "{\"k\":\"\\u0001\\u0002\"}",
+                     "{\"k\":\"\\u0001\\u0002\"}"));
 
     json_parser_destroy(p);
 }