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

Skip to content

Commit f2ca323

Browse files
committed
addressed comments
fixed additional recent tests
1 parent eb0a999 commit f2ca323

7 files changed

Lines changed: 53 additions & 7 deletions

source/core/ut_suite_manager.pkb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ create or replace package body ut_suite_manager is
8484
l_suite_name := l_annotation_data.package_annotations('suite').text;
8585
end if;
8686

87-
if l_annotation_data.package_annotations.exists('suitepath') and trim(l_annotation_data.package_annotations('suitepath').text) is not null then
87+
if l_annotation_data.package_annotations.exists('suitepath') and l_annotation_data.package_annotations('suitepath').text is not null then
8888
l_suite_path := l_annotation_data.package_annotations('suitepath').text || '.' || lower(l_object_name);
8989
end if;
9090

tests/ut_annotations/ut_annotations.parse_package_annotations.spaceBeforeAnnotationParams.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ END;';
2121
l_parsing_result := ut_annotations.parse_package_annotations(l_source);
2222

2323
--Assert
24-
l_ann_param := null;
25-
l_ann_param.val := 'Name of suite';
2624
l_expected.package_annotations('suite').params := cast( null as ut_annotations.tt_annotation_params);
2725

2826
l_ann_param := null;

tests/ut_suite_manager/ut_suite_manager.PackageWithDollarSign.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,16 @@ set termout on
1717

1818
declare
1919
l_objects_to_run ut_suite_items;
20+
l_suite ut_suite;
2021
begin
2122
--act
2223
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with$dollar'));
24+
25+
--Assert
26+
ut.expect(l_objects_to_run.count).to_equal(1);
27+
28+
l_suite := treat(l_objects_to_run(1) as ut_suite);
29+
ut.expect(l_suite.name).to_equal('tst_package_with$dollar');
2330

2431
if ut_expectation_processor.get_status = ut_utils.tr_success then
2532
:test_result := ut_utils.tr_success;

tests/ut_suite_manager/ut_suite_manager.PackageWithHash.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,18 @@ set termout on
1717

1818
declare
1919
l_objects_to_run ut_suite_items;
20+
l_suite ut_suite;
2021
begin
2122

2223
--act
2324
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with#hash'));
2425

26+
--Assert
27+
ut.expect(l_objects_to_run.count).to_equal(1);
28+
29+
l_suite := treat(l_objects_to_run(1) as ut_suite);
30+
ut.expect(l_suite.name).to_equal('tst_package_with#hash');
31+
2532
if ut_expectation_processor.get_status = ut_utils.tr_success then
2633
:test_result := ut_utils.tr_success;
2734
end if;

tests/ut_suite_manager/ut_suite_manager.TestWithDollarSign.sql

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,30 @@ end;
99

1010
create or replace package body tst_package_with_dollar_test as
1111
procedure test$1 is begin ut.expect(1).to_equal(1); end;
12-
procedure test$2 is begin ut.expect(1).to_equal(1); end;
1312
end;
1413
/
1514

1615
set termout on
1716

1817
declare
1918
l_objects_to_run ut_suite_items;
19+
l_suite ut_suite;
20+
l_test ut_test;
2021
begin
2122
--act
2223
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with_dollar_test.test$1'));
24+
25+
--Assert
26+
ut.expect(l_objects_to_run.count).to_equal(1);
27+
28+
l_suite := treat(l_objects_to_run(1) as ut_suite);
29+
30+
ut.expect(l_suite.name).to_equal('tst_package_with_dollar_test');
31+
ut.expect(l_suite.items.count).to_equal(1);
32+
33+
l_test := treat(l_suite.items(1) as ut_test);
34+
35+
ut.expect(l_test.name).to_equal('test$1');
2336

2437
if ut_expectation_processor.get_status = ut_utils.tr_success then
2538
:test_result := ut_utils.tr_success;

tests/ut_suite_manager/ut_suite_manager.TestWithHashSign.sql

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,31 @@ end;
99

1010
create or replace package body tst_package_with_hash_test as
1111
procedure test#1 is begin ut.expect(1).to_equal(1); end;
12-
procedure test#2 is begin ut.expect(1).to_equal(1); end;
1312
end;
1413
/
1514

1615
set termout on
1716

1817
declare
1918
l_objects_to_run ut_suite_items;
19+
l_suite ut_suite;
20+
l_test ut_test;
2021
begin
2122

2223
--act
2324
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_package_with_hash_test.test#1'));
25+
26+
--Assert
27+
ut.expect(l_objects_to_run.count).to_equal(1);
28+
29+
l_suite := treat(l_objects_to_run(1) as ut_suite);
30+
31+
ut.expect(l_suite.name).to_equal('tst_package_with_hash_test');
32+
ut.expect(l_suite.items.count).to_equal(1);
33+
34+
l_test := treat(l_suite.items(1) as ut_test);
35+
36+
ut.expect(l_test.name).to_equal('test#1');
2437

2538
if ut_expectation_processor.get_status = ut_utils.tr_success then
2639
:test_result := ut_utils.tr_success;

tests/ut_suite_manager/ut_suite_manager.emptySuitePath.sql

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,31 @@ create or replace package tst_empty_suite_path as
44
--%suitepath
55

66
--%test
7-
procedure test#1;
7+
procedure test1;
88
end;
99
/
1010

1111
create or replace package body tst_empty_suite_path as
12-
procedure test#1 is begin ut.expect(1).to_equal(1); end;
12+
procedure test1 is begin ut.expect(1).to_equal(1); end;
1313
end;
1414
/
1515

1616
set termout on
1717

1818
declare
1919
l_objects_to_run ut_suite_items;
20+
l_suite ut_suite;
2021
begin
2122

2223
--act
2324
l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_empty_suite_path'));
25+
26+
--Assert
27+
ut.expect(l_objects_to_run.count).to_equal(1);
28+
29+
l_suite := treat(l_objects_to_run(1) as ut_suite);
30+
31+
ut.expect(l_suite.name).to_equal('tst_empty_suite_path');
2432

2533
if ut_expectation_processor.get_status = ut_utils.tr_success then
2634
:test_result := ut_utils.tr_success;

0 commit comments

Comments
 (0)