Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions abaplint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@
"pack": true,
"selectWithoutInto": true,
"clientSpecified": false,
"commonPart": true,
"fieldGroups": true,
"replaceInto": true,
"occurences": true,
"regex": false,
"exitFromSQL": true,
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
},
"license": "MIT",
"dependencies": {
"@abaplint/cli": "^2.113.233",
"@abaplint/cli": "^2.113.237",
"@abaplint/database-pg": "^2.11.78",
"@abaplint/database-sqlite": "^2.11.78",
"@abaplint/runtime": "^2.12.7",
"@abaplint/transpiler-cli": "^2.12.7",
"@abaplint/runtime": "^2.12.9",
"@abaplint/transpiler-cli": "^2.12.9",
"0x": "^6.0.0"
}
}
15 changes: 0 additions & 15 deletions src/abap/regex/cl_abap_matcher.clas.testclasses.abap

This file was deleted.

6 changes: 5 additions & 1 deletion src/abap/regex/cl_abap_regex.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ CLASS cl_abap_regex DEFINITION PUBLIC.

METHODS create_matcher
IMPORTING
text TYPE clike
text TYPE clike OPTIONAL
table TYPE STANDARD TABLE OPTIONAL
RETURNING
VALUE(ro_matcher) TYPE REF TO cl_abap_matcher.

Expand Down Expand Up @@ -45,6 +46,9 @@ CLASS cl_abap_regex IMPLEMENTATION.
ENDMETHOD.

METHOD create_matcher.
" this is a todo,
ASSERT table IS INITIAL.

CREATE OBJECT ro_matcher
EXPORTING
pattern = mv_pattern
Expand Down
22 changes: 22 additions & 0 deletions src/abap/regex/cl_abap_regex.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CLASS ltcl_test DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
METHODS pcre FOR TESTING RAISING cx_static_check.
METHODS replace_oo FOR TESTING RAISING cx_static_check.
METHODS pcre_slashes FOR TESTING RAISING cx_static_check.
METHODS digits FOR TESTING RAISING cx_static_check.
METHODS classic_slashes FOR TESTING RAISING cx_static_check.

ENDCLASS.
Expand Down Expand Up @@ -218,4 +219,25 @@ CLASS ltcl_test IMPLEMENTATION.

ENDMETHOD.

METHOD digits.

DATA l_offset TYPE i.
DATA l_counter TYPE string.
DATA name TYPE string.
DATA lo_regex TYPE REF TO cl_abap_regex.

name = 'notFound'.
CREATE OBJECT lo_regex EXPORTING pattern = '([[:digit:]]*)$'.
FIND FIRST OCCURRENCE OF REGEX lo_regex IN name SUBMATCHES l_counter MATCH OFFSET l_offset.

cl_abap_unit_assert=>assert_equals(
act = l_counter
exp = '' ).

cl_abap_unit_assert=>assert_equals(
act = l_offset
exp = 8 ).

ENDMETHOD.

ENDCLASS.
1 change: 1 addition & 0 deletions src/icon.type.abap
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ CONSTANTS icon_total_left TYPE c LENGTH 4 VALUE 'ICON'.
CONSTANTS icon_transport TYPE c LENGTH 4 VALUE 'ICON'.
CONSTANTS icon_variable TYPE c LENGTH 4 VALUE 'ICON'.
CONSTANTS icon_warehouse TYPE c LENGTH 4 VALUE 'ICON'.
CONSTANTS icon_warning TYPE c LENGTH 4 VALUE 'ICON'.
CONSTANTS icon_wd_context TYPE c LENGTH 4 VALUE 'ICON'.
CONSTANTS icon_wd_table TYPE c LENGTH 4 VALUE 'ICON'.
CONSTANTS icon_wf_workitem_completed TYPE c LENGTH 4 VALUE 'ICON'.
Expand Down
17 changes: 12 additions & 5 deletions src/ixml/if_ixml_node.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ INTERFACE if_ixml_node PUBLIC.
RETURNING VALUE(rval) TYPE REF TO if_ixml_unknown,
remove_node,
get_parent RETURNING VALUE(val) TYPE REF TO if_ixml_node,
replace_child IMPORTING
new_child TYPE string
old_child TYPE string,
get_name RETURNING VALUE(val) TYPE string,
get_depth RETURNING VALUE(val) TYPE i,
is_leaf RETURNING VALUE(val) TYPE abap_bool,
Expand All @@ -26,8 +23,18 @@ INTERFACE if_ixml_node PUBLIC.
get_type RETURNING VALUE(val) TYPE string,
set_name IMPORTING name TYPE string,
set_namespace_prefix IMPORTING val TYPE string,
remove_child IMPORTING child TYPE REF TO if_ixml_node,
set_value IMPORTING value TYPE string.
remove_child IMPORTING child TYPE REF TO if_ixml_node.

METHODS replace_child
IMPORTING
new_child TYPE REF TO if_ixml_node
old_child TYPE REF TO if_ixml_node.

METHODS set_value
IMPORTING
value TYPE string
RETURNING
VALUE(rval) TYPE i.

METHODS get_gid
RETURNING
Expand Down
25 changes: 25 additions & 0 deletions src/json/#ui2#cl_json.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ CLASS ltcl_deserialize DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT
METHODS refs_something FOR TESTING RAISING cx_static_check.
METHODS raw_to_string FOR TESTING RAISING cx_static_check.
METHODS string_to_raw FOR TESTING RAISING cx_static_check.
METHODS top_tab FOR TESTING RAISING cx_static_check.

ENDCLASS.

Expand Down Expand Up @@ -214,6 +215,30 @@ CLASS ltcl_deserialize IMPLEMENTATION.
exp = 2 ).
ENDMETHOD.

METHOD top_tab.

DATA lv_json TYPE string.
TYPES: BEGIN OF ty,
path TYPE string,
filename TYPE string,
sha1 TYPE c LENGTH 10,
data TYPE xstring,
END OF ty.
DATA tab TYPE STANDARD TABLE OF ty WITH DEFAULT KEY.
lv_json = '[{"path":"","filename":"","sha1":"","data":""}]'.

/ui2/cl_json=>deserialize(
EXPORTING
json = lv_json
CHANGING
data = tab ).

cl_abap_unit_assert=>assert_equals(
act = lines( tab )
exp = 1 ).

ENDMETHOD.

METHOD structure_string.
DATA: BEGIN OF stru,
foo TYPE string,
Expand Down