From d119d42a248d3eccf2a96e395574201e98d1fd6f Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Tue, 10 Oct 2023 16:19:01 +0200 Subject: [PATCH] bugfix, abap_abstypename --- src/rtti/cl_abap_typedescr.clas.abap | 4 ++-- src/rtti/cl_abap_typedescr.clas.testclasses.abap | 4 ++-- src/unit/cl_abap_unit_assert.clas.testclasses.abap | 9 +++++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/rtti/cl_abap_typedescr.clas.abap b/src/rtti/cl_abap_typedescr.clas.abap index 97f65857..f271291b 100644 --- a/src/rtti/cl_abap_typedescr.clas.abap +++ b/src/rtti/cl_abap_typedescr.clas.abap @@ -59,7 +59,7 @@ CLASS cl_abap_typedescr DEFINITION PUBLIC. DATA ddic TYPE abap_bool. DATA length TYPE i. DATA decimals TYPE i. - DATA absolute_name TYPE string. + DATA absolute_name TYPE abap_abstypename. DATA relative_name TYPE string. CONSTANTS typekind_any TYPE abap_typekind VALUE '~'. @@ -428,7 +428,7 @@ CLASS cl_abap_typedescr IMPLEMENTATION. * this is not completely correct, local type names and ddic names might overlap, but will work for now, * todo: use/check getDDICName() in the future, - WRITE '@KERNEL if(abap.DDIC[type.get().absolute_name.get().toUpperCase()]) { type.get().ddic.set("X"); }'. + WRITE '@KERNEL if(abap.DDIC[type.get().absolute_name.get().toUpperCase().trimEnd()]) { type.get().ddic.set("X"); }'. TRANSLATE type->absolute_name TO UPPER CASE. TRANSLATE type->relative_name TO UPPER CASE. diff --git a/src/rtti/cl_abap_typedescr.clas.testclasses.abap b/src/rtti/cl_abap_typedescr.clas.testclasses.abap index 88fe70b5..f52910fd 100644 --- a/src/rtti/cl_abap_typedescr.clas.testclasses.abap +++ b/src/rtti/cl_abap_typedescr.clas.testclasses.abap @@ -61,7 +61,7 @@ CLASS ltcl_test DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL. METHODS is_ddic_type_true2 FOR TESTING. METHODS is_ddic_type_false FOR TESTING. - METHODS contant_field_absolute FOR TESTING. + METHODS constant_field_absolute FOR TESTING. METHODS structure_field_absolute FOR TESTING. METHODS unnamed_type FOR TESTING. METHODS describe_by_dashed FOR TESTING. @@ -507,7 +507,7 @@ CLASS ltcl_test IMPLEMENTATION. exp = 16 ). ENDMETHOD. - METHOD contant_field_absolute. + METHOD constant_field_absolute. DATA lo_descr TYPE REF TO cl_abap_typedescr. lo_descr = cl_abap_typedescr=>describe_by_data( lif_test_types=>c_foo-true ). diff --git a/src/unit/cl_abap_unit_assert.clas.testclasses.abap b/src/unit/cl_abap_unit_assert.clas.testclasses.abap index 974f0977..41015752 100644 --- a/src/unit/cl_abap_unit_assert.clas.testclasses.abap +++ b/src/unit/cl_abap_unit_assert.clas.testclasses.abap @@ -15,6 +15,7 @@ CLASS ltcl_test DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL. METHODS differs FOR TESTING RAISING cx_static_check. METHODS cp1 FOR TESTING RAISING cx_static_check. METHODS cp2 FOR TESTING RAISING cx_static_check. + METHODS cp3 FOR TESTING RAISING cx_static_check. METHODS char_eq_string FOR TESTING RAISING cx_static_check. METHODS decfloat34_eq FOR TESTING RAISING cx_static_check. METHODS decfloat34_ne FOR TESTING RAISING cx_static_check. @@ -60,6 +61,14 @@ CLASS ltcl_test IMPLEMENTATION. exp = '*oo*' ). ENDMETHOD. + METHOD cp3. + DATA foo TYPE c LENGTH 200. + foo = '\CLASS=LIF_TEST_TYPES\TYPE=FOO'. + cl_abap_unit_assert=>assert_char_cp( + act = foo + exp = '*\TYPE=FOO' ). + ENDMETHOD. + METHOD initial_numbers. DATA foo TYPE i. DATA bar TYPE f.