Skip to content

Commit

Permalink
1.14.2 (#389)
Browse files Browse the repository at this point in the history
* 1.14.2

* Update changelog.txt

* fix #388 (#390)

* fix #388

* act = '' and exp = ''

* Update changelog.txt
  • Loading branch information
lucasborin authored May 7, 2021
1 parent 12c87e7 commit f290ccf
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Upgrade Note
------------------
Whenever you upgrade code pal for ABAP, it is highly recommended to execute the Y_CI_CHECK_REGISTRATION report to activate/reactivate the Checks (SE38 transaction) and regenerate the respective Code Inspector Variant (SCI transaction)

2021-05-07 v.1.14.2
------------------
* Y_CHECK_UNIT_TEST_ASSERT: False-positive (#388)

2021-05-03 v.1.14.1
------------------
+ Assert Classes (#378)
Expand Down
5 changes: 5 additions & 0 deletions src/checks/y_check_unit_test_assert.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ CLASS y_check_unit_test_assert IMPLEMENTATION.
RETURN.
ENDTRY.

IF act IS INITIAL
OR exp IS INITIAL.
RETURN.
ENDIF.

IF act <> exp.
RETURN.
ENDIF.
Expand Down
56 changes: 56 additions & 0 deletions src/checks/y_check_unit_test_assert.clas.testclasses.abap
Original file line number Diff line number Diff line change
Expand Up @@ -532,3 +532,59 @@ CLASS ltc_call_static IMPLEMENTATION.
ENDMETHOD.

ENDCLASS.



CLASS ltc_assert_fail DEFINITION INHERITING FROM ltc_hardcoded_string FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PROTECTED SECTION.
METHODS get_code_without_issue REDEFINITION.
ENDCLASS.

CLASS ltc_assert_fail IMPLEMENTATION.

METHOD get_code_without_issue.
result = VALUE #(
( ' REPORT y_example. ' )

( ' CLASS y_example DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. ' )
( ' PUBLIC SECTION. ' )
( ' METHODS example FOR TESTING. ' )
( ' ENDCLASS. ' )

( ' CLASS y_example IMPLEMENTATION. ' )
( ' METHOD example. ' )
( | cl_aunit_assert=>fail( msg = 'method ended unexpectedly' ). | )
( ' ENDMETHOD. ' )
( ' ENDCLASS. ' )
).
ENDMETHOD.

ENDCLASS.



CLASS ltc_assert_empty DEFINITION INHERITING FROM ltc_hardcoded_string FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PROTECTED SECTION.
METHODS get_code_with_issue REDEFINITION.
ENDCLASS.

CLASS ltc_assert_empty IMPLEMENTATION.

METHOD get_code_with_issue.
result = VALUE #(
( ' REPORT y_example. ' )

( ' CLASS y_example DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. ' )
( ' PUBLIC SECTION. ' )
( ' METHODS example FOR TESTING. ' )
( ' ENDCLASS. ' )

( ' CLASS y_example IMPLEMENTATION. ' )
( ' METHOD example. ' )
( | cl_aunit_assert=>assert_equals( act = '' exp = '' ). | )
( ' ENDMETHOD. ' )
( ' ENDCLASS. ' )
).
ENDMETHOD.

ENDCLASS.
2 changes: 1 addition & 1 deletion src/y_code_pal_version.intf.abap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
INTERFACE y_code_pal_version PUBLIC.
CONSTANTS abap TYPE string VALUE '1.14.1' ##NO_TEXT.
CONSTANTS abap TYPE string VALUE '1.14.2' ##NO_TEXT.
ENDINTERFACE.

0 comments on commit f290ccf

Please sign in to comment.