Parse simple strings

This commit is contained in:
Benoit Blanchon committed 2014-10-15 23:39:25 +02:00
1 parent 3d92531ad3
commit 241ca79114
3 files changed
+37

No files matched your search

+15
View File
@@ -45,6 +45,11 @@ protected:
EXPECT_EQ(expected, static_cast<T>(_array[index]));
}
void elementAtIndexMustBe(int index, const char* expected)
{
EXPECT_STREQ(expected, static_cast<const char*>(_array[index]));
}
StaticJsonBuffer<42> _jsonBuffer;
JsonArray _array;
char _jsonString[256];
@@ -147,4 +152,14 @@ TEST_F(JsonArray_Parser_Tests, TwoNulls)
sizeMustBe(2);
firstElementMustBe(nullCharPtr);
secondElementMustBe(nullCharPtr);
}
TEST_F(JsonArray_Parser_Tests, TwoStrings)
{
whenInputIs("[\"hello\",\"world\"]");
parseMustSucceed();
sizeMustBe(2);
firstElementMustBe("hello");
secondElementMustBe("world");
}