Hard batch G0022-G0026: 5/5 accepted; budget floor, CDS checks, mutation check
- generator: budget floor (2x oracle activations, 3x calls), static checks for CDS $parameters and UNION annotation - harness/mutation.py: deterministic mutants of the reference; hidden tests must fail - G0022 revalidated with harness fixes: oracle 100, null 0 - results in docs/faz1-tasarim.md 11f Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
15
tasks_gen/eval/G0024/reference/i_sales_report.ddls.asddls
Normal file
15
tasks_gen/eval/G0024/reference/i_sales_report.ddls.asddls
Normal file
@@ -0,0 +1,15 @@
|
||||
@AccessControl.authorizationCheck: #NOT_REQUIRED
|
||||
@EndUserText.label: 'Sales per product in a period'
|
||||
define view entity {{P}}I_SALES_REPORT
|
||||
with parameters
|
||||
p_from : abap.dats,
|
||||
p_to : abap.dats
|
||||
as select from {{p}}sales as sale
|
||||
{
|
||||
key sale.product as product,
|
||||
sum( sale.quantity ) as total_qty,
|
||||
sum( cast( sale.quantity as abap.dec( 15, 2 ) ) * sale.price ) as total_amount
|
||||
}
|
||||
where sale.sold_on >= $parameters.p_from
|
||||
and sale.sold_on <= $parameters.p_to
|
||||
group by sale.product
|
||||
44
tasks_gen/eval/G0024/reference/t16_test.clas.abap
Normal file
44
tasks_gen/eval/G0024/reference/t16_test.clas.abap
Normal file
@@ -0,0 +1,44 @@
|
||||
CLASS {{p}}t16_test DEFINITION PUBLIC FINAL CREATE PUBLIC
|
||||
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS.
|
||||
PRIVATE SECTION.
|
||||
CLASS-DATA go_env TYPE REF TO if_cds_test_environment.
|
||||
CLASS-METHODS class_setup.
|
||||
CLASS-METHODS class_teardown.
|
||||
METHODS setup.
|
||||
METHODS period_is_inclusive FOR TESTING.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}t16_test IMPLEMENTATION.
|
||||
METHOD class_setup.
|
||||
go_env = cl_cds_test_environment=>create( i_for_entity = '{{P}}I_SALES_REPORT' ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD class_teardown.
|
||||
go_env->destroy( ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD setup.
|
||||
DATA lt_sales TYPE STANDARD TABLE OF {{p}}sales WITH EMPTY KEY.
|
||||
go_env->clear_doubles( ).
|
||||
lt_sales = VALUE #(
|
||||
( doc_id = 'S1' item_no = 1 product = 'P1' quantity = 2 price = '1.50' sold_on = '20240501' )
|
||||
( doc_id = 'S1' item_no = 2 product = 'P1' quantity = 1 price = '4.00' sold_on = '20240531' )
|
||||
( doc_id = 'S2' item_no = 1 product = 'P2' quantity = 9 price = '0.10' sold_on = '20240601' ) ).
|
||||
go_env->insert_test_data( lt_sales ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD period_is_inclusive.
|
||||
DATA lv_from TYPE d.
|
||||
DATA lv_to TYPE d.
|
||||
lv_from = '20240501'.
|
||||
lv_to = '20240531'.
|
||||
SELECT SINGLE total_qty, total_amount
|
||||
FROM {{p}}i_sales_report( p_from = @lv_from, p_to = @lv_to )
|
||||
WHERE product = 'P1'
|
||||
INTO @DATA(ls_result).
|
||||
cl_abap_unit_assert=>assert_equals( exp = 3 act = ls_result-total_qty ).
|
||||
cl_abap_unit_assert=>assert_equals( exp = CONV decfloat34( '7.00' )
|
||||
act = CONV decfloat34( ls_result-total_amount ) ).
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user