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:
108
tasks_gen/eval/G0013/hidden/t21_hidden.clas.abap
Normal file
108
tasks_gen/eval/G0013/hidden/t21_hidden.clas.abap
Normal file
@@ -0,0 +1,108 @@
|
||||
CLASS {{p}}t21_hidden DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
TYPES: BEGIN OF ty_result,
|
||||
qty TYPE decfloat34,
|
||||
action TYPE string,
|
||||
subrc TYPE sysubrc,
|
||||
END OF ty_result.
|
||||
METHODS call
|
||||
IMPORTING iv_stock TYPE decfloat34
|
||||
iv_safety TYPE decfloat34
|
||||
iv_lot_size TYPE decfloat34
|
||||
iv_min_order TYPE decfloat34
|
||||
RETURNING VALUE(rs_result) TYPE ty_result.
|
||||
METHODS exact_multiple_lot FOR TESTING.
|
||||
METHODS exact_multiple_single_lot FOR TESTING.
|
||||
METHODS exact_multiple_with_minimum FOR TESTING.
|
||||
METHODS partial_lot_rounds_up FOR TESTING.
|
||||
METHODS stock_above_safety FOR TESTING.
|
||||
METHODS stock_equals_safety FOR TESTING.
|
||||
METHODS no_lot_size_no_rounding FOR TESTING.
|
||||
METHODS minimum_order_applies FOR TESTING.
|
||||
METHODS minimum_order_keeps_quantity FOR TESTING.
|
||||
METHODS negative_lot_size FOR TESTING.
|
||||
METHODS negative_min_order FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t21_hidden IMPLEMENTATION.
|
||||
METHOD call.
|
||||
CALL FUNCTION '{{P}}REPL_QTY'
|
||||
EXPORTING
|
||||
iv_stock = iv_stock
|
||||
iv_safety = iv_safety
|
||||
iv_lot_size = iv_lot_size
|
||||
iv_min_order = iv_min_order
|
||||
IMPORTING
|
||||
ev_order_qty = rs_result-qty
|
||||
ev_action = rs_result-action
|
||||
EXCEPTIONS
|
||||
invalid_input = 1
|
||||
OTHERS = 2.
|
||||
rs_result-subrc = sy-subrc.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD exact_multiple_lot.
|
||||
DATA(ls_result) = call( iv_stock = 0 iv_safety = 100 iv_lot_size = 50 iv_min_order = 0 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = ls_result-subrc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 100 ) act = ls_result-qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = `ORDER` act = ls_result-action ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD exact_multiple_single_lot.
|
||||
DATA(ls_result) = call( iv_stock = 0 iv_safety = 50 iv_lot_size = 50 iv_min_order = 0 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 0 act = ls_result-subrc ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 50 ) act = ls_result-qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD exact_multiple_with_minimum.
|
||||
DATA(ls_result) = call( iv_stock = 0 iv_safety = 100 iv_lot_size = 50 iv_min_order = 120 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 120 ) act = ls_result-qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = `ORDER` act = ls_result-action ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD partial_lot_rounds_up.
|
||||
DATA(ls_result) = call( iv_stock = 0 iv_safety = 110 iv_lot_size = 50 iv_min_order = 0 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 150 ) act = ls_result-qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = `ORDER` act = ls_result-action ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD stock_above_safety.
|
||||
DATA(ls_result) = call( iv_stock = 200 iv_safety = 100 iv_lot_size = 50 iv_min_order = 50 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = ls_result-qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = `NONE` act = ls_result-action ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD stock_equals_safety.
|
||||
DATA(ls_result) = call( iv_stock = 100 iv_safety = 100 iv_lot_size = 50 iv_min_order = 0 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 0 ) act = ls_result-qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = `NONE` act = ls_result-action ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD no_lot_size_no_rounding.
|
||||
DATA(ls_result) = call( iv_stock = 0 iv_safety = '37.5' iv_lot_size = 0 iv_min_order = 0 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '37.5' ) act = ls_result-qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = `ORDER` act = ls_result-action ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_order_applies.
|
||||
DATA(ls_result) = call( iv_stock = 0 iv_safety = 10 iv_lot_size = 0 iv_min_order = 25 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 25 ) act = ls_result-qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD minimum_order_keeps_quantity.
|
||||
DATA(ls_result) = call( iv_stock = 0 iv_safety = 100 iv_lot_size = 0 iv_min_order = 25 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( 100 ) act = ls_result-qty ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD negative_lot_size.
|
||||
DATA(ls_result) = call( iv_stock = 0 iv_safety = 100 iv_lot_size = -1 iv_min_order = 0 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_result-subrc ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD negative_min_order.
|
||||
DATA(ls_result) = call( iv_stock = 0 iv_safety = 100 iv_lot_size = 0 iv_min_order = -1 ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 1 act = ls_result-subrc ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user