MCPcopy Create free account
hub / github.com/boostorg/json / testObject

Method testObject

test/stream_parser.cpp:907–970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

905 //------------------------------------------------------
906
907 void
908 testObject()
909 {
910 grind("{}");
911 grind(" {}");
912 grind("{} ");
913 grind(" {} ");
914 grind(" { } ");
915 grind("{\"1\":1}");
916 grind("{ \"1\":1}");
917 grind("{\"1\" :1}");
918 grind("{\"1\": 1}");
919 grind("{\"1\":1 }");
920 grind("{ \"1\" :1 }");
921 grind("{\"1\" : 1 }");
922 grind("{\"1\":1,\"2\":2}");
923 grind("{\"1\":1, \"2\":2}");
924 grind("{\"1\":1, \"2\" : 2 }");
925
926 grind("{\"\":[]}");
927 grind("{\"1\":[],\"2\":[]}");
928
929 grind(
930 "{\"1\":{\"2\":{}},\"3\":{\"4\":{},\"5\":{}},"
931 "\"6\":{\"7\":{},\"8\":{},\"9\":{}}}");
932
933 grind(
934 "{\"1\":{},\"2\":[],\"3\":\"x\",\"4\":1,"
935 "\"5\":-1,\"6\":1.0,\"7\":false,\"8\":null}");
936
937 // big keys
938 {
939 std::string const big(4000, '*');
940 {
941 std::string js;
942 js = "{\"" + big + "\":null}";
943 grind(js);
944 }
945
946 {
947 std::string js;
948 js = "{\"x\":\"" + big + "\"}";
949 grind(js);
950 }
951
952 {
953 std::string js;
954 js = "{\"" + big + "\":\"" + big + "\"}";
955 grind(js);
956 }
957 }
958
959 // depth
960 {
961 system::error_code ec;
962 parse_options opt;
963 opt.max_depth = 0;
964 stream_parser p(storage_ptr(), opt);

Callers

nothing calls this directly

Calls 2

storage_ptrClass · 0.50
writeMethod · 0.45

Tested by

no test coverage detected