forked from bblanchon/ArduinoJson
Test an object with two memebrs
This commit is contained in:
@ -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)
|
||||||
|
@ -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[])
|
||||||
|
Reference in New Issue
Block a user