ejson/test/testNull.cpp

29 lines
715 B
C++
Raw Permalink Normal View History

2015-01-12 21:12:44 +01:00
/**
* @author Edouard DUPIN
* @copyright 2011, Edouard DUPIN, all right reserved
* @license MPL v2.0 (see license file)
2015-01-12 21:12:44 +01:00
*/
2016-09-30 22:28:36 +02:00
#include "testCommon.hpp"
2017-09-07 23:38:26 +02:00
#include <etest/etest.hpp>
2015-01-12 21:12:44 +01:00
2017-08-28 00:03:43 +02:00
static etk::String refOutputNull("{\n\t\"tmpElement\": null\n}\n");
2015-01-12 21:12:44 +01:00
TEST(TestNull, testBasicNullElement) {
localTest(refOutputNull, "{ tmpElement:null }\n", -1);
}
TEST(TestNull, testTabbedNullElement) {
localTest(refOutputNull, "{ \t\ntmpElement:null \t\n }\n", -1);
}
TEST(TestNull, testTabbedNullElementNoPThese) {
localTest(refOutputNull, "tmpElement:null\n", -1);
}
TEST(TestNull, multipleElement) {
localTest("{\n\t\"tmpElement\": null,\n\t\"tmpElement2\": null\n}\n", "{tmpElement:null, tmpElement2:null\n}", -1);
}