Test an object with two memebrs

This commit is contained in:
Benoit Blanchon
2014-08-25 10:22:42 +02:00
parent eb1a774778
commit aafabd8e8d
2 changed files with 13 additions and 0 deletions

View File

@ -26,6 +26,9 @@ size_t IndentedPrintDecorator::write(uint8_t c)
return writeln() + sink.write(c); return writeln() + sink.write(c);
} }
case ',':
return sink.write(c) + writeln();
default: default:
if (emptyBlock) if (emptyBlock)

View File

@ -46,6 +46,16 @@ namespace JsonGeneratorTests
"}"); "}");
} }
TEST_METHOD(ObjectWithTwoMembers)
{
whenInputIs("{\"key1\":\"value1\",\"key2\":\"value2\"}");
outputMustBe(
"{\n"
" \"key1\":\"value1\",\n"
" \"key2\":\"value2\"\n"
"}");
}
private: private:
void whenInputIs(const char input[]) void whenInputIs(const char input[])