diff --git a/JsonGeneratorTests/JsonArray.h b/JsonGeneratorTests/JsonArray.h index 06ba5040..3fead4f9 100644 --- a/JsonGeneratorTests/JsonArray.h +++ b/JsonGeneratorTests/JsonArray.h @@ -82,7 +82,7 @@ public: { case JSON_STRING: if (value.string) - append(buffer, bufferSize, "'%s'", value.string); + append(buffer, bufferSize, "\"%s\"", value.string); else append(buffer, bufferSize, "null"); break; diff --git a/JsonGeneratorTests/JsonArrayTests.cpp b/JsonGeneratorTests/JsonArrayTests.cpp index 2cb8f553..ec5e3ccd 100644 --- a/JsonGeneratorTests/JsonArrayTests.cpp +++ b/JsonGeneratorTests/JsonArrayTests.cpp @@ -27,7 +27,7 @@ namespace JsonGeneratorTests { arr.add("hello"); - AssertJsonIs("['hello']"); + AssertJsonIs("[\"hello\"]"); } TEST_METHOD(AddTwoStrings) @@ -35,7 +35,7 @@ namespace JsonGeneratorTests arr.add("hello"); arr.add("world"); - AssertJsonIs("['hello','world']"); + AssertJsonIs("[\"hello\",\"world\"]"); } TEST_METHOD(AddOneStringOverCapacity) @@ -44,7 +44,7 @@ namespace JsonGeneratorTests arr.add("world"); arr.add("lost"); - AssertJsonIs("['hello','world']"); + AssertJsonIs("[\"hello\",\"world\"]"); } TEST_METHOD(AddOneNumber)