-
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
64cab8e
fix error with space before annotation params
Pazus eb0a999
Merge branch 'develop' into issue-357
jgebal f2ca323
addressed comments
Pazus e1893ae
Merge branch 'develop' into issue-357
Pazus 4d9f9ae
Merge branch 'develop' into issue-357
Pazus 413e63f
added trailing spaces processing
Pazus f1e22e4
Merge branch 'develop' into issue-357
Pazus 2c4ffde
Merge branch 'develop' into issue-357
Pazus 76b2df3
Merge branch 'develop' into issue-357
jgebal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...s/ut_annotations/ut_annotations.parse_package_annotations.spaceBeforeAnnotationParams.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| --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_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; | ||
| / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
tests/ut_suite_manager/ut_suite_manager.emptySuitePath.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| set termout off | ||
| create or replace package tst_empty_suite_path as | ||
| --%suite | ||
| --%suitepath | ||
|
|
||
| --%test | ||
| procedure test1; | ||
| end; | ||
| / | ||
|
|
||
| create or replace package body tst_empty_suite_path as | ||
| procedure test1 is begin ut.expect(1).to_equal(1); end; | ||
| end; | ||
| / | ||
|
|
||
| set termout on | ||
|
|
||
| declare | ||
| l_objects_to_run ut_suite_items; | ||
| l_suite ut_suite; | ||
| begin | ||
|
|
||
| --act | ||
| l_objects_to_run := ut_suite_manager.configure_execution_by_path(ut_varchar2_list('tst_empty_suite_path')); | ||
|
|
||
| --Assert | ||
| ut.expect(l_objects_to_run.count).to_equal(1); | ||
|
|
||
| l_suite := treat(l_objects_to_run(1) as ut_suite); | ||
|
|
||
| ut.expect(l_suite.name).to_equal('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 | ||
| / | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)||']*$)?'