@@ -24,6 +24,7 @@ class ltcl_string_map definition
2424 methods from_entries for testing .
2525 methods freeze for testing .
2626 methods create_from for testing .
27+ methods case_insensitive for testing .
2728
2829endclass .
2930
@@ -41,7 +42,7 @@ class ltcl_string_map implementation.
4142 iv_val = '1' ).
4243
4344 try .
44- zcl_abap_string_map=>create( `abc` ).
45+ zcl_abap_string_map=>create( iv_from = `abc` ).
4546 cl_abap_unit_assert=>fail( ).
4647 catch cx_root into lx.
4748 cl_abap_unit_assert=>assert_equals(
@@ -50,7 +51,7 @@ class ltcl_string_map implementation.
5051 endtry .
5152
5253 try .
53- zcl_abap_string_map=>create( me ).
54+ zcl_abap_string_map=>create( iv_from = me ).
5455 cl_abap_unit_assert=>fail( ).
5556 catch cx_root into lx.
5657 cl_abap_unit_assert=>assert_equals(
@@ -59,7 +60,7 @@ class ltcl_string_map implementation.
5960 endtry .
6061
6162 " From obj
62- lo_cut = zcl_abap_string_map=>create( lo_src ).
63+ lo_cut = zcl_abap_string_map=>create( iv_from = lo_src ).
6364 cl_abap_unit_assert=>assert_equals(
6465 exp = 1
6566 act = lo_cut->size( ) ).
@@ -68,7 +69,7 @@ class ltcl_string_map implementation.
6869 act = lo_cut->get( 'A' ) ).
6970
7071 " From tab
71- lo_cut = zcl_abap_string_map=>create( lo_src->mt_entries ).
72+ lo_cut = zcl_abap_string_map=>create( iv_from = lo_src->mt_entries ).
7273 cl_abap_unit_assert=>assert_equals(
7374 exp = 1
7475 act = lo_cut->size( ) ).
@@ -78,7 +79,7 @@ class ltcl_string_map implementation.
7879
7980 " From struc
8081 data : begin of ls_dummy, a type string value '1' , end of ls_dummy.
81- lo_cut = zcl_abap_string_map=>create( ls_dummy ).
82+ lo_cut = zcl_abap_string_map=>create( iv_from = ls_dummy ).
8283 cl_abap_unit_assert=>assert_equals(
8384 exp = 1
8485 act = lo_cut->size( ) ).
@@ -479,4 +480,42 @@ class ltcl_string_map implementation.
479480
480481 endmethod .
481482
483+ method case_insensitive .
484+
485+ data lo_cut type ref to zcl_abap_string_map.
486+ lo_cut = zcl_abap_string_map=>create( iv_case_insensitive = abap_true ).
487+
488+ lo_cut->set(
489+ iv_key = 'A'
490+ iv_val = 'avalue' ).
491+ lo_cut->set(
492+ iv_key = 'b'
493+ iv_val = 'bvalue' ).
494+
495+ cl_abap_unit_assert=>assert_equals(
496+ exp = 'avalue'
497+ act = lo_cut->get( 'A' ) ).
498+
499+ cl_abap_unit_assert=>assert_equals(
500+ exp = 'avalue'
501+ act = lo_cut->get( 'a' ) ).
502+
503+ cl_abap_unit_assert=>assert_equals(
504+ exp = 'bvalue'
505+ act = lo_cut->get( 'B' ) ).
506+
507+ cl_abap_unit_assert=>assert_equals(
508+ exp = 'bvalue'
509+ act = lo_cut->get( 'b' ) ).
510+
511+ data lt_exp_keys type string_table.
512+ append 'A' to lt_exp_keys.
513+ append 'B' to lt_exp_keys.
514+
515+ cl_abap_unit_assert=>assert_equals(
516+ exp = lt_exp_keys
517+ act = lo_cut->keys( ) ).
518+
519+ endmethod .
520+
482521endclass .
0 commit comments