Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75b96c3

Browse files
committed
Fixed double warning on missing endcontext annotation.
Fixed tests.
1 parent 93be873 commit 75b96c3

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

source/core/ut_suite_builder.pkb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,6 @@ create or replace package body ut_suite_builder is
480480
while l_context_pos is not null loop
481481
l_end_context_pos := get_endcontext_position(l_context_pos, a_package_ann_index);
482482
if l_end_context_pos is null then
483-
a_suite.put_warning(
484-
'Annotation "--%context('||a_annotations(l_context_pos).text||')" was ignored. Cannot find following "--%endcontext".');
485483
exit;
486484
end if;
487485

@@ -554,7 +552,7 @@ create or replace package body ut_suite_builder is
554552
duplicate_annotations_warning(l_suite, l_package_ann_index, 'suite');
555553

556554
add_suite_contexts( l_suite, l_annotations, l_package_ann_index );
557-
555+
--by this time all contexts were consumed and l_annotations should not have any context/endcontext annotation in it.
558556
warning_on_incomplete_context( l_suite, l_annotations, l_package_ann_index );
559557

560558
populate_suite_contents( l_suite, l_annotations, l_package_ann_index );

test/core/test_suite_builder.pkb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,14 +366,15 @@ create or replace package body test_suite_builder is
366366
ut.expect(l_actual).to_be_like(
367367
'%<UT_LOGICAL_SUITE><SELF_TYPE>UT_SUITE</SELF_TYPE><OBJECT_OWNER>UT3_TESTER</OBJECT_OWNER>' ||
368368
'<OBJECT_NAME>some_package</OBJECT_NAME><NAME>some_package</NAME><DESCRIPTION>Cool</DESCRIPTION>' ||
369-
'%<WARNINGS><VARCHAR2>Annotations: &quot;--%afterall&quot;, &quot;--%aftereach&quot;, &quot;--%beforeall&quot;, &quot;--%beforeeach&quot;' ||
369+
'%<WARNINGS><VARCHAR2>Annotations: &quot;--\%afterall&quot;, &quot;--\%aftereach&quot;, &quot;--\%beforeall&quot;, &quot;--\%beforeeach&quot;' ||
370370
' were ignored for procedure &quot;DO_STUFF&quot;.' ||
371371
' Those annotations cannot be used with annotation: &quot;--%test&quot;</VARCHAR2></WARNINGS>%'||
372372
'%<UT_SUITE_ITEM>%<OBJECT_NAME>some_package</OBJECT_NAME>%<NAME>do_stuff</NAME>' ||
373373
'%<BEFORE_EACH_LIST/>' ||
374374
'%<AFTER_EACH_LIST/>' ||
375375
'%<BEFORE_ALL_LIST/>' ||
376376
'%<AFTER_ALL_LIST/>%'
377+
,'\'
377378
);
378379
end;
379380

@@ -440,7 +441,7 @@ create or replace package body test_suite_builder is
440441
--Assert
441442
ut.expect(l_actual).to_be_like(
442443
'%<UT_LOGICAL_SUITE>' ||
443-
'%<WARNINGS><VARCHAR2>Annotation &quot;--%context(A context)&quot; was ignored. Cannot find following &quot;--%endcontext&quot;.</VARCHAR2></WARNINGS>' ||
444+
'%<WARNINGS><VARCHAR2>Annotation &quot;--\%context(A context)&quot; was ignored. Cannot find following &quot;--\%endcontext&quot;.</VARCHAR2></WARNINGS>' ||
444445
'%<ITEMS>' ||
445446
'<UT_SUITE_ITEM>' ||
446447
'%<NAME>suite_level_test</NAME><DESCRIPTION>In suite</DESCRIPTION><PATH>some_package.suite_level_test</PATH>' ||
@@ -455,6 +456,7 @@ create or replace package body test_suite_builder is
455456
'%</BEFORE_ALL_LIST>' ||
456457
'<AFTER_ALL_LIST/>' ||
457458
'</UT_LOGICAL_SUITE>'
459+
,'\'
458460
);
459461
end;
460462

@@ -478,7 +480,7 @@ create or replace package body test_suite_builder is
478480
--Assert
479481
ut.expect(l_actual).to_be_like(
480482
'%<UT_LOGICAL_SUITE>' ||
481-
'%<WARNINGS><VARCHAR2>Annotation &quot;--%endcontext&quot; was ignored. Cannot find preceding &quot;--%context&quot;.</VARCHAR2></WARNINGS>' ||
483+
'%<WARNINGS><VARCHAR2>Annotation &quot;--\%endcontext&quot; was ignored. Cannot find preceding &quot;--\%context&quot;.</VARCHAR2></WARNINGS>' ||
482484
'%<ITEMS>' ||
483485
'<UT_SUITE_ITEM>' ||
484486
'%<NAME>context_1</NAME><DESCRIPTION>A context</DESCRIPTION><PATH>some_package.context_1</PATH>' ||
@@ -501,6 +503,7 @@ create or replace package body test_suite_builder is
501503
'%</BEFORE_ALL_LIST>' ||
502504
'<AFTER_ALL_LIST/>' ||
503505
'</UT_LOGICAL_SUITE>'
506+
,'\'
504507
);
505508
end;
506509

0 commit comments

Comments
 (0)