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

Skip to content

Commit f7c2730

Browse files
authored
Merge pull request #465 from pesse/develop
Added tests from old tests to new approach. Thanks @pesse - nice work.
2 parents 0b77ce1 + bad957a commit f7c2730

2 files changed

Lines changed: 71 additions & 0 deletions

File tree

test/ut_annotations/test_annotations.pkb

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,5 +510,70 @@ END;';
510510
check_annotation_parsing(l_expected, l_parsing_result);
511511
end;
512512

513+
procedure test_windows_newline
514+
as
515+
l_source clob;
516+
l_parsing_result ut3.ut_annotations.typ_annotated_package;
517+
l_expected ut3.ut_annotations.typ_annotated_package;
518+
l_ann_param ut3.ut_annotations.typ_annotation_param;
519+
begin
520+
l_source := 'PACKAGE test_tt AS
521+
-- %suite
522+
-- %displayname(Name of suite)' || chr(13) || chr(10)
523+
|| ' -- %suitepath(all.globaltests)
524+
END;';
525+
526+
--Act
527+
l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source);
528+
529+
--Assert
530+
l_ann_param := null;
531+
l_ann_param.val := 'Name of suite';
532+
l_expected.package_annotations('suite').params := cast( null as ut3.ut_annotations.tt_annotation_params);
533+
l_expected.package_annotations('displayname').params(1) := l_ann_param;
534+
535+
l_ann_param := null;
536+
l_ann_param.val := 'all.globaltests';
537+
l_expected.package_annotations('suitepath').params(1) := l_ann_param;
538+
539+
check_annotation_parsing(l_expected, l_parsing_result);
540+
end;
541+
542+
procedure test_annot_very_long_name
543+
as
544+
l_source clob;
545+
l_parsing_result ut3.ut_annotations.typ_annotated_package;
546+
l_expected ut3.ut_annotations.typ_annotated_package;
547+
l_ann_param ut3.ut_annotations.typ_annotation_param;
548+
begin
549+
l_source := 'PACKAGE test_tt AS
550+
-- %suite
551+
-- %displayname(Name of suite)
552+
-- %suitepath(all.globaltests)
553+
554+
--%test
555+
procedure very_long_procedure_name_valid_for_oracle_12_so_utplsql_should_allow_it_definitely_well_still_not_reached_128_but_wait_we_ditit;
556+
END;';
557+
558+
--Act
559+
l_parsing_result := ut3.ut_annotations.parse_package_annotations(l_source);
560+
561+
--Assert
562+
l_ann_param := null;
563+
l_ann_param.val := 'Name of suite';
564+
l_expected.package_annotations('suite').params := cast( null as ut3.ut_annotations.tt_annotation_params);
565+
l_expected.package_annotations('displayname').params(1) := l_ann_param;
566+
567+
l_ann_param := null;
568+
l_ann_param.val := 'all.globaltests';
569+
l_expected.package_annotations('suitepath').params(1) := l_ann_param;
570+
571+
l_expected.procedure_annotations(1).name := 'very_long_procedure_name_valid_for_oracle_12_so_utplsql_should_allow_it_definitely_well_still_not_reached_128_but_wait_we_ditit';
572+
l_expected.procedure_annotations(1).annotations('test').params := cast( null as ut3.ut_annotations.tt_annotation_params);
573+
574+
check_annotation_parsing(l_expected, l_parsing_result);
575+
end;
576+
577+
513578
end test_annotations;
514579
/

test/ut_annotations/test_annotations.pks

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,11 @@ create or replace package test_annotations is
3636
--%test(Test space before annotation params)
3737
procedure test_space_Before_Annot_Params;
3838

39+
-- %test(Test annotations with windows newline)
40+
procedure test_windows_newline;
41+
42+
-- %test(Test annotation function with very long name)
43+
procedure test_annot_very_long_name;
44+
3945
end test_annotations;
4046
/

0 commit comments

Comments
 (0)