Skip to content

Commit f290ccf

Browse files
authored
1.14.2 (#389)
* 1.14.2 * Update changelog.txt * fix #388 (#390) * fix #388 * act = '' and exp = '' * Update changelog.txt
1 parent 12c87e7 commit f290ccf

File tree

4 files changed

+66
-1
lines changed

4 files changed

+66
-1
lines changed

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ Upgrade Note
1212
------------------
1313
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)
1414

15+
2021-05-07 v.1.14.2
16+
------------------
17+
* Y_CHECK_UNIT_TEST_ASSERT: False-positive (#388)
18+
1519
2021-05-03 v.1.14.1
1620
------------------
1721
+ Assert Classes (#378)

src/checks/y_check_unit_test_assert.clas.abap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ CLASS y_check_unit_test_assert IMPLEMENTATION.
5454
RETURN.
5555
ENDTRY.
5656

57+
IF act IS INITIAL
58+
OR exp IS INITIAL.
59+
RETURN.
60+
ENDIF.
61+
5762
IF act <> exp.
5863
RETURN.
5964
ENDIF.

src/checks/y_check_unit_test_assert.clas.testclasses.abap

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,3 +532,59 @@ CLASS ltc_call_static IMPLEMENTATION.
532532
ENDMETHOD.
533533

534534
ENDCLASS.
535+
536+
537+
538+
CLASS ltc_assert_fail DEFINITION INHERITING FROM ltc_hardcoded_string FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
539+
PROTECTED SECTION.
540+
METHODS get_code_without_issue REDEFINITION.
541+
ENDCLASS.
542+
543+
CLASS ltc_assert_fail IMPLEMENTATION.
544+
545+
METHOD get_code_without_issue.
546+
result = VALUE #(
547+
( ' REPORT y_example. ' )
548+
549+
( ' CLASS y_example DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. ' )
550+
( ' PUBLIC SECTION. ' )
551+
( ' METHODS example FOR TESTING. ' )
552+
( ' ENDCLASS. ' )
553+
554+
( ' CLASS y_example IMPLEMENTATION. ' )
555+
( ' METHOD example. ' )
556+
( | cl_aunit_assert=>fail( msg = 'method ended unexpectedly' ). | )
557+
( ' ENDMETHOD. ' )
558+
( ' ENDCLASS. ' )
559+
).
560+
ENDMETHOD.
561+
562+
ENDCLASS.
563+
564+
565+
566+
CLASS ltc_assert_empty DEFINITION INHERITING FROM ltc_hardcoded_string FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
567+
PROTECTED SECTION.
568+
METHODS get_code_with_issue REDEFINITION.
569+
ENDCLASS.
570+
571+
CLASS ltc_assert_empty IMPLEMENTATION.
572+
573+
METHOD get_code_with_issue.
574+
result = VALUE #(
575+
( ' REPORT y_example. ' )
576+
577+
( ' CLASS y_example DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT. ' )
578+
( ' PUBLIC SECTION. ' )
579+
( ' METHODS example FOR TESTING. ' )
580+
( ' ENDCLASS. ' )
581+
582+
( ' CLASS y_example IMPLEMENTATION. ' )
583+
( ' METHOD example. ' )
584+
( | cl_aunit_assert=>assert_equals( act = '' exp = '' ). | )
585+
( ' ENDMETHOD. ' )
586+
( ' ENDCLASS. ' )
587+
).
588+
ENDMETHOD.
589+
590+
ENDCLASS.

src/y_code_pal_version.intf.abap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
INTERFACE y_code_pal_version PUBLIC.
2-
CONSTANTS abap TYPE string VALUE '1.14.1' ##NO_TEXT.
2+
CONSTANTS abap TYPE string VALUE '1.14.2' ##NO_TEXT.
33
ENDINTERFACE.

0 commit comments

Comments
 (0)