diff options
Diffstat (limited to 'plugin/business/tsg-http/test/test_edit_element.cpp')
| -rw-r--r-- | plugin/business/tsg-http/test/test_edit_element.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/plugin/business/tsg-http/test/test_edit_element.cpp b/plugin/business/tsg-http/test/test_edit_element.cpp index 5893846..d441674 100644 --- a/plugin/business/tsg-http/test/test_edit_element.cpp +++ b/plugin/business/tsg-http/test/test_edit_element.cpp @@ -223,9 +223,28 @@ TEST(EditElement, LibXML_Inside_Mark_Match) free(output); } -int main(int argc, char ** argv) +TEST(EditElement, Cjson_multi_json_Facebook_Test) { + char* output=NULL; + size_t output_sz=0, input_sz=0; + + const char *input="{\"A\":\"B\",\"C\":[\"D\", \"E\"],\"F\":{\"G\":{\"H\":\"I\"}},\"J\":{\"K\":[{\"L\":\"M\"}],\"N\":\"Q\"}}\n\n{\"data\":{\"user\":{\"id\":\"1\",\ + \"units\":{\"edges\":[{\"eligible\":true,\"story\":{\"message\":{\"text\":\"safari 5.7.1 with System\"}}}]}}}}\n\n{\"data\":{\"user\":{\"id\":\"1\",\"units\":\ + {\"edges\":[{\"eligible\":true,\"story\":{\"message\":{\"text\":\"Firefox 3.6 with System\\uff0c\\u7f16\\u8f91\"}}}]}}}}"; + + const char *user_region = "{\"rules\":[{\"anchor_element\":{\"search_scope\":\"whole_file\",\"start_indicator\":\"message\",\"contained_keyword\":\"safari 5.7.1 with System\"},\ + \"target_element\":{\"target_distance_from_matching\":1,\"element_treatment\":\"remove\"}}]}"; + + input_sz = strlen(input); + simple_edit_element(user_region, input, input_sz, &output, &output_sz, 0); + EXPECT_TRUE(output_sz>0); + printf("output =%s\n", output); + free(output); +} + +int main(int argc, char ** argv) +{ ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } |
