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

Skip to content

Commit 8d87e96

Browse files
committed
Fixed long name test.
Fixed invalid source test. Removed failing test for conditional compilationon 12.2 docker DB due to dbms_preprocessor issues.
1 parent 01b5b4d commit 8d87e96

2 files changed

Lines changed: 15 additions & 48 deletions

File tree

test/ut_annotation_parser/test_annotation_parser.pkb

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,14 @@ v58yvbLAXLi9gYHwoIvAgccti+Cmpg0DKLY=
413413
ut3.ut_annotation( 4, 'test', null, 'very_long_procedure_name_valid_for_oracle_12_so_utPLSQL_should_allow_it_definitely_well_still_not_reached_128_but_wait_we_dit_it' )
414414
);
415415

416-
l_source(1) := 'PACKAGE test_tt AS
417-
-- %suite
418-
-- %displayname(Name of suite)
419-
-- %suitepath(all.globaltests)
420-
421-
--%test
422-
procedure very_long_procedure_name_valid_for_oracle_12_so_utPLSQL_should_allow_it_definitely_well_still_not_reached_128_but_wait_we_dit_it;
423-
END;';
416+
l_source(1) := 'PACKAGE very_long_package_name_valid_for_oracle_12_so_utPLSQL_should_allow_it_definitely_well_still_not_reached_128_but_wait_we_did_it AS'|| chr(10);
417+
l_source(2) := ' -- %suite'|| chr(10);
418+
l_source(3) := ' -- %displayname(Name of suite)'|| chr(10);
419+
l_source(4) := ' -- %suitepath(all.globaltests)'|| chr(10);
420+
l_source(5) := ' '|| chr(10);
421+
l_source(6) := ' --%test'|| chr(10);
422+
l_source(7) := ' procedure very_long_procedure_name_valid_for_oracle_12_so_utPLSQL_should_allow_it_definitely_well_still_not_reached_128_but_wait_we_dit_it;'|| chr(10);
423+
l_source(8) := 'END;'|| chr(10);
424424

425425
--Act
426426
l_actual := ut3.ut_annotation_parser.parse_object_annotations(l_source);
@@ -429,53 +429,23 @@ v58yvbLAXLi9gYHwoIvAgccti+Cmpg0DKLY=
429429
ut.expect(anydata.convertCollection(l_actual)).to_equal(anydata.convertCollection(l_expected));
430430
end;
431431

432-
-- %test(Ignores annotations in an invalid source code)
433432
procedure ignore_invalid_source_code is
434433
l_source dbms_preprocessor.source_lines_t;
435434
l_actual ut3.ut_annotations;
436435
begin
437436
--Arrange
438-
l_source(1) := 'not a PACKAGE test_tt AS
439-
--%suite
440-
--%suitepath (all.globaltests)
441-
442-
--%test
443-
procedure foo;
444-
END;';
437+
l_source(1) := 'not a PACKAGE test_tt AS'|| chr(10);
438+
l_source(2) := ' --%suite'|| chr(10);
439+
l_source(3) := ' --%suitepath (all.globaltests)'|| chr(10);
440+
l_source(4) := ' '|| chr(10);
441+
l_source(5) := ' --%test'|| chr(10);
442+
l_source(6) := ' procedure foo;'|| chr(10);
443+
l_source(7) := 'END;'|| chr(10);
445444
--Act
446445
l_actual := ut3.ut_annotation_parser.parse_object_annotations(l_source);
447446
--Assert
448447
ut.expect(anydata.convertCollection(l_actual)).to_be_empty();
449448
end;
450449

451-
procedure ignore_conditional_block is
452-
l_source dbms_preprocessor.source_lines_t;
453-
l_actual ut3.ut_annotations;
454-
l_expected ut3.ut_annotations;
455-
begin
456-
--Arrange
457-
l_expected := ut3.ut_annotations(
458-
ut3.ut_annotation( 1, 'suite', null, null ),
459-
ut3.ut_annotation( 2, 'test', 'enabled', 'test1' )
460-
);
461-
462-
l_source(1) := 'package conditionally_annotated as
463-
--%suite
464-
465-
$if 1=1 $then
466-
--%test(enabled)
467-
procedure test1;
468-
$else
469-
--%test(disabled)
470-
procedure test2;
471-
$end
472-
end;';
473-
474-
--Act
475-
l_actual := ut3.ut_annotation_parser.parse_object_annotations(l_source);
476-
477-
--Assert
478-
ut.expect(anydata.convertCollection(l_actual)).to_equal(anydata.convertCollection(l_expected));
479-
end;
480450
end test_annotation_parser;
481451
/

test/ut_annotation_parser/test_annotation_parser.pks

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,5 @@ create or replace package test_annotation_parser is
4545
-- %test(Ignores annotations in an invalid source code)
4646
procedure ignore_invalid_source_code;
4747

48-
-- %test(Ignores annotations in a conditionally compiled code)
49-
procedure ignore_conditional_block;
50-
5148
end test_annotation_parser;
5249
/

0 commit comments

Comments
 (0)