From 04f52733c21e66940b61da2d5a986382e333b1be Mon Sep 17 00:00:00 2001 From: Benoit Blanchon Date: Sat, 19 Jul 2014 16:15:57 +0200 Subject: [PATCH] Added a test with 3 strings --- JsonParserTests/JsonArrayIteratorTests.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/JsonParserTests/JsonArrayIteratorTests.cpp b/JsonParserTests/JsonArrayIteratorTests.cpp index b1774fd3..292d57d4 100644 --- a/JsonParserTests/JsonArrayIteratorTests.cpp +++ b/JsonParserTests/JsonArrayIteratorTests.cpp @@ -43,5 +43,21 @@ namespace JsonParserTests Assert::AreEqual(expected[index++], i); } } + + TEST_METHOD(ThreeStrings) + { + char json[] = "[\"1\",\"2\",\"3\"]"; + char* expected[] = { "1", "2", "3" }; + JsonParser<4> parser; + + JsonArray a = parser.parse(json); + + int index = 0; + + for (const char* i : a) + { + Assert::AreEqual(expected[index++], i); + } + } }; } \ No newline at end of file