Generator: pilot analysis and fixes; G0002-G0021 tasks; handover notes merged
- Static bundle checks (name length, seed type, reserved words, contract test classes, testclasses_file), local abaplint parser check before SAP, max_tokens, robust JSON parse - Runner: G2 for CDS views with parameters, contract_check detail in report - G0020 and G0013 fixed by review and revalidated (oracle 100, null 0) - Pilot results in docs/faz1-tasarim.md 11e; handover notes merged into CLAUDE.md and docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
117
tasks_gen/eval/G0011/hidden/t14_hidden.clas.abap
Normal file
117
tasks_gen/eval/G0011/hidden/t14_hidden.clas.abap
Normal file
@@ -0,0 +1,117 @@
|
||||
CLASS {{p}}t14_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
METHODS call
|
||||
IMPORTING
|
||||
iv_stock TYPE decfloat34
|
||||
iv_reorder_point TYPE decfloat34
|
||||
iv_target_stock TYPE decfloat34
|
||||
iv_pack_size TYPE decfloat34
|
||||
iv_min_qty TYPE decfloat34 DEFAULT 0
|
||||
EXPORTING
|
||||
ev_qty TYPE decfloat34
|
||||
ev_subrc TYPE sysubrc.
|
||||
METHODS no_replenishment_when_stock_ok FOR TESTING.
|
||||
METHODS replenish_to_target FOR TESTING.
|
||||
METHODS pack_rounding_up FOR TESTING.
|
||||
METHODS exact_multiple_not_rounded FOR TESTING.
|
||||
METHODS minimum_quantity_applied FOR TESTING.
|
||||
METHODS minimum_quantity_rounded_up FOR TESTING.
|
||||
METHODS negative_minimum_is_zero FOR TESTING.
|
||||
METHODS target_below_stock_is_zero FOR TESTING.
|
||||
METHODS invalid_pack_size FOR TESTING.
|
||||
METHODS class_calculates_directly FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t14_hidden IMPLEMENTATION.
|
||||
METHOD call.
|
||||
ev_qty = 0.
|
||||
CALL FUNCTION '{{P}}REPL_CALC'
|
||||
EXPORTING
|
||||
iv_stock = iv_stock
|
||||
iv_reorder_point = iv_reorder_point
|
||||
iv_target_stock = iv_target_stock
|
||||
iv_pack_size = iv_pack_size
|
||||
iv_min_qty = iv_min_qty
|
||||
IMPORTING
|
||||
ev_qty = ev_qty
|
||||
EXCEPTIONS
|
||||
invalid_pack_size = 1
|
||||
OTHERS = 2.
|
||||
ev_subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD no_replenishment_when_stock_ok.
|
||||
DATA lv_qty TYPE decfloat34.
|
||||
call( EXPORTING iv_stock = 50 iv_reorder_point = 20 iv_target_stock = 100 iv_pack_size = 10
|
||||
IMPORTING ev_qty = lv_qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD replenish_to_target.
|
||||
DATA lv_qty TYPE decfloat34.
|
||||
call( EXPORTING iv_stock = 10 iv_reorder_point = 20 iv_target_stock = 50 iv_pack_size = 12
|
||||
IMPORTING ev_qty = lv_qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 48 ) act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD pack_rounding_up.
|
||||
DATA lv_qty TYPE decfloat34.
|
||||
call( EXPORTING iv_stock = 0 iv_reorder_point = 10 iv_target_stock = 25 iv_pack_size = 6
|
||||
IMPORTING ev_qty = lv_qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 30 ) act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD exact_multiple_not_rounded.
|
||||
DATA lv_qty TYPE decfloat34.
|
||||
call( EXPORTING iv_stock = 0 iv_reorder_point = 10 iv_target_stock = 24 iv_pack_size = 12
|
||||
IMPORTING ev_qty = lv_qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 24 ) act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_quantity_applied.
|
||||
DATA lv_qty TYPE decfloat34.
|
||||
call( EXPORTING iv_stock = 10 iv_reorder_point = 20 iv_target_stock = 12 iv_pack_size = 1 iv_min_qty = 7
|
||||
IMPORTING ev_qty = lv_qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 7 ) act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_quantity_rounded_up.
|
||||
DATA lv_qty TYPE decfloat34.
|
||||
call( EXPORTING iv_stock = 10 iv_reorder_point = 20 iv_target_stock = 12 iv_pack_size = 5 iv_min_qty = 7
|
||||
IMPORTING ev_qty = lv_qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 10 ) act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD negative_minimum_is_zero.
|
||||
DATA lv_qty TYPE decfloat34.
|
||||
call( EXPORTING iv_stock = 0 iv_reorder_point = 10 iv_target_stock = 10 iv_pack_size = 4 iv_min_qty = -5
|
||||
IMPORTING ev_qty = lv_qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 12 ) act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD target_below_stock_is_zero.
|
||||
DATA lv_qty TYPE decfloat34.
|
||||
call( EXPORTING iv_stock = 10 iv_reorder_point = 20 iv_target_stock = 5 iv_pack_size = 4
|
||||
IMPORTING ev_qty = lv_qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD invalid_pack_size.
|
||||
DATA lv_rc TYPE sysubrc.
|
||||
call( EXPORTING iv_stock = 0 iv_reorder_point = 10 iv_target_stock = 20 iv_pack_size = 0
|
||||
IMPORTING ev_subrc = lv_rc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = lv_rc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_calculates_directly.
|
||||
DATA(lv_qty) = NEW {{p}}cl_repl( )->calculate(
|
||||
iv_stock = 10
|
||||
iv_reorder_point = 20
|
||||
iv_target_stock = 50
|
||||
iv_pack_size = 12
|
||||
iv_min_qty = 0 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 48 ) act = lv_qty ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user