-
Notifications
You must be signed in to change notification settings - Fork 189
Fix error with space before annotation params #375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
64cab8e
eb0a999
f2ca323
e1893ae
4d9f9ae
413e63f
f1e22e4
2c4ffde
76b2df3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,7 +84,7 @@ create or replace package body ut_suite_manager is | |
| l_suite_name := l_annotation_data.package_annotations('suite').text; | ||
| end if; | ||
|
|
||
| if l_annotation_data.package_annotations.exists('suitepath') then | ||
| if l_annotation_data.package_annotations.exists('suitepath') and trim(l_annotation_data.package_annotations('suitepath').text) is not null then | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that the |
||
| l_suite_path := l_annotation_data.package_annotations('suitepath').text || '.' || lower(l_object_name); | ||
| end if; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| --Arrange | ||
| declare | ||
| l_source clob; | ||
| l_parsing_result ut_annotations.typ_annotated_package; | ||
| l_expected ut_annotations.typ_annotated_package; | ||
| l_ann_param ut_annotations.typ_annotation_param; | ||
|
|
||
| begin | ||
| l_source := 'PACKAGE test_tt AS | ||
| /* | ||
| Some comment | ||
| -- inlined | ||
| */ | ||
| -- %suite | ||
| -- %suitepath (all.globaltests) | ||
|
|
||
| procedure foo; | ||
| END;'; | ||
|
|
||
| --Act | ||
| l_parsing_result := ut_annotations.parse_package_annotations(l_source); | ||
|
|
||
| --Assert | ||
| l_ann_param := null; | ||
| l_ann_param.val := 'Name of suite'; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lines 24 and 25 are not used I think |
||
| l_expected.package_annotations('suite').params := cast( null as ut_annotations.tt_annotation_params); | ||
|
|
||
| l_ann_param := null; | ||
| l_ann_param.val := 'all.globaltests'; | ||
| l_expected.package_annotations('suitepath').params(1) := l_ann_param; | ||
|
|
||
| check_annotation_parsing(l_expected, l_parsing_result); | ||
|
|
||
| if ut_expectation_processor.get_status = ut_utils.tr_success then | ||
| :test_result := ut_utils.tr_success; | ||
| end if; | ||
|
|
||
| end; | ||
| / | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| set termout off | ||
| create or replace package tst_empty_suite_path as | ||
| --%suite | ||
| --%suitepath | ||
|
|
||
| --%test | ||
| procedure test#1; | ||
| end; | ||
| / | ||
|
|
||
| create or replace package body tst_empty_suite_path as | ||
| procedure test#1 is begin ut.expect(1).to_equal(1); end; | ||
| end; | ||
| / | ||
|
|
||
| set termout on | ||
|
|
||
| declare | ||
| l_objects_to_run ut_suite_items; | ||
| begin | ||
|
|
||
| --act | ||
| l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_empty_suite_path')); | ||
|
|
||
| if ut_expectation_processor.get_status = ut_utils.tr_success then | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand how will this test ever fail, as there is no expectation executed before status is checked. |
||
| :test_result := ut_utils.tr_success; | ||
| end if; | ||
|
|
||
| end; | ||
| / | ||
|
|
||
| drop package tst_empty_suite_path | ||
| / | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we use
\s*rather thanchr(9)?We should also enhance the pattern to allow \s at the end I think.
So how about:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\scontains new line character which is not allowedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make the regexp work with trailing spaces?
'[ '||chr(9)||]((.?)[ '||chr(9)||']*$)?'