File tree Expand file tree Collapse file tree 2 files changed +58
-3
lines changed Expand file tree Collapse file tree 2 files changed +58
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ CLASS zcl_htmldiff DEFINITION
1717
1818 PUBLIC SECTION .
1919
20- CONSTANTS c_version TYPE string VALUE '1.0.0 ' ##NEEDED .
20+ CONSTANTS c_version TYPE string VALUE '1.0.1 ' ##NEEDED .
2121
2222 INTERFACES zif_htmldiff.
2323
@@ -762,8 +762,8 @@ CLASS zcl_htmldiff IMPLEMENTATION.
762762
763763 METHOD is_character .
764764
765- " Alphanumeric characters (includes underscore)
766- FIND REGEX '[\w]' IN iv_input.
765+ " Alphanumeric characters (includes underscore) plus characters to identify HTML symbol entities
766+ FIND REGEX '[\w&#; ]' IN iv_input.
767767
768768 rv_result = xsdbool ( sy -subrc = 0 ).
769769
Original file line number Diff line number Diff line change @@ -1208,3 +1208,58 @@ CLASS ltcl_render_operations IMPLEMENTATION.
12081208 ENDMETHOD .
12091209
12101210ENDCLASS .
1211+
1212+ ************************************************************************
1213+ * Tests for ABAP implementation
1214+ ************************************************************************
1215+
1216+ CLASS ltcl_htmldiff_test_3 DEFINITION FOR TESTING
1217+ DURATION SHORT
1218+ RISK LEVEL HARMLESS .
1219+
1220+ PRIVATE SECTION .
1221+
1222+ METHODS :
1223+ html_symbol_entities FOR TESTING ,
1224+ tags_and_entities FOR TESTING .
1225+
1226+ ENDCLASS .
1227+
1228+ CLASS ltcl_htmldiff_test_3 IMPLEMENTATION .
1229+
1230+ METHOD html_symbol_entities .
1231+
1232+ DATA :
1233+ lv_act TYPE string ,
1234+ lv_exp TYPE string .
1235+
1236+ lv_act = lcl_helper=>htmldiff(
1237+ iv_before = 'a < c'
1238+ iv_after = 'a > c' ).
1239+
1240+ lv_exp = 'a <del><</del><ins>></ins> c' .
1241+
1242+ cl_abap_unit_assert=>assert_equals(
1243+ act = lv_act
1244+ exp = lv_exp ).
1245+
1246+ ENDMETHOD .
1247+
1248+ METHOD tags_and_entities .
1249+
1250+ DATA :
1251+ lv_act TYPE string ,
1252+ lv_exp TYPE string .
1253+
1254+ lv_act = lcl_helper=>htmldiff(
1255+ iv_before = '<ls_var>'
1256+ iv_after = '<span class="keyword">FIELD-SYMBOL</span>(<ls_var>)' ).
1257+
1258+ lv_exp = '<span class="keyword"><ins>FIELD-SYMBOL</ins></span><ins>(</ins><ls_var><ins>)</ins>' .
1259+
1260+ cl_abap_unit_assert=>assert_equals(
1261+ act = lv_act
1262+ exp = lv_exp ).
1263+
1264+ ENDMETHOD .
1265+ ENDCLASS .
You can’t perform that action at this time.
0 commit comments