Skip to content

bugfix REPLACE #932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 24, 2025
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
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.104",
"@abaplint/cli": "^2.113.107",
"@abaplint/database-pg": "^2.10.24",
"@abaplint/database-sqlite": "^2.10.24",
"@abaplint/runtime": "^2.10.26",
"@abaplint/transpiler-cli": "^2.10.26",
"@abaplint/runtime": "^2.10.27",
"@abaplint/transpiler-cli": "^2.10.27",
"0x": "^5.8.0"
}
}
20 changes: 20 additions & 0 deletions src/abap/regex/cl_abap_regex.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CLASS ltcl_test DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
METHODS tags FOR TESTING RAISING cx_static_check.
METHODS find_hello FOR TESTING RAISING cx_static_check.
METHODS pcre FOR TESTING RAISING cx_static_check.
METHODS replace_oo FOR TESTING RAISING cx_static_check.

ENDCLASS.

Expand Down Expand Up @@ -157,4 +158,23 @@ CLASS ltcl_test IMPLEMENTATION.

ENDMETHOD.

METHOD replace_oo.

DATA lv_line TYPE string.
DATA lo_regex TYPE REF TO cl_abap_regex.

lv_line = 'hello'.

CREATE OBJECT lo_regex
EXPORTING
pattern = 'hello'.

REPLACE FIRST OCCURRENCE OF REGEX lo_regex IN lv_line WITH ``.

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

ENDMETHOD.

ENDCLASS.