File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,8 @@ class ltcl_parser_test definition final
9595 methods special_characters_in_path for testing raising zcx_ajson_error.
9696 methods special_characters_in_value for testing raising zcx_ajson_error.
9797 methods unicode_characters for testing raising zcx_ajson_error.
98+ methods parse_empty_object for testing raising zcx_ajson_error.
99+ methods parse_empty_string for testing raising zcx_ajson_error.
98100
99101endclass .
100102
@@ -632,6 +634,35 @@ class ltcl_parser_test implementation.
632634
633635 endmethod .
634636
637+ method parse_empty_object .
638+
639+ data lo_cut type ref to lcl_json_parser.
640+ data lt_act type zif_ajson_types=>ty_nodes_tt.
641+
642+ mo_nodes->add( ' | |object | | |0' ).
643+
644+ create object lo_cut.
645+ lt_act = lo_cut->parse( `{}` ).
646+ cl_abap_unit_assert=>assert_equals(
647+ act = lt_act
648+ exp = mo_nodes->mt_nodes ).
649+
650+ endmethod .
651+
652+ method parse_empty_string .
653+
654+ data lo_cut type ref to lcl_json_parser.
655+
656+ create object lo_cut.
657+
658+ try .
659+ lo_cut->parse( `` ).
660+ cl_abap_unit_assert=>fail( `empty string should raise an exception` ).
661+ catch zcx_ajson_error.
662+ endtry .
663+
664+ endmethod .
665+
635666endclass .
636667
637668**********************************************************************
You can’t perform that action at this time.
0 commit comments