Skip to content

Feature/1042 add and to tags #1250

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 35 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
0daab33
Checkpoint
lwasylow Mar 28, 2023
adbc76e
Address too long identified in 11g.
lwasylow Mar 28, 2023
1478b0d
Adding validation for tag expression
lwasylow Mar 29, 2023
b5ad747
Comment out to see why its failing.
lwasylow Mar 29, 2023
06cb054
Revert "Comment out to see why its failing."
lwasylow Mar 29, 2023
e87d39f
Adding validate function, with no calls
lwasylow Mar 29, 2023
97537de
Remove a & from text
lwasylow Mar 29, 2023
2a0f99a
Extra changes and added tests
lwasylow Mar 31, 2023
5b46140
Merge branch 'develop' of https://github.com/utPLSQL/utPLSQL into fea…
lwasylow Mar 31, 2023
b30688c
Address sonar coverage issues.
lwasylow Apr 1, 2023
0c41a0f
Adding tests covering exception of invalid tags
lwasylow Apr 1, 2023
543685d
Removing that , we will not implement that, there is no benefit at th…
lwasylow Apr 1, 2023
0d3cfa1
Removing force
lwasylow Apr 1, 2023
20e3177
Changing to use Dijkstra algorithm to parse infix notation into postf…
lwasylow Apr 10, 2023
f51cc99
Missing slash at end of type
lwasylow Apr 10, 2023
4b8e2ab
Cleanup.
lwasylow Apr 10, 2023
84e8684
Update tests after removed function
lwasylow Apr 10, 2023
2e7a766
Tidy up tests
lwasylow Apr 10, 2023
cbdf83a
Added ut_stack to uninstall
lwasylow Apr 10, 2023
436eb5b
Addressing test failures and sonar smells
lwasylow Apr 11, 2023
3d77514
Update name
lwasylow Apr 11, 2023
bf6959f
Update tests and code
lwasylow Apr 11, 2023
d8233ff
fixing typo in docs
lwasylow Apr 12, 2023
bd860f6
Removed unused variable
lwasylow Apr 12, 2023
313d5e9
Stage 1 Resolving PR comments
lwasylow Apr 13, 2023
02a071c
Separate tag logic.
lwasylow Apr 13, 2023
b8b66ee
Fix uninstall
lwasylow Apr 14, 2023
077fdb1
Various PR fixe
lwasylow Apr 14, 2023
01e5364
Update tests and code
lwasylow Apr 15, 2023
dc0b4a6
Addressing changes via PR review.
lwasylow Apr 18, 2023
ef1c02b
Update docs
lwasylow Apr 18, 2023
1551ea5
Adding any and none
lwasylow Apr 25, 2023
9dee7e0
Update docs
lwasylow Apr 26, 2023
beb9a3a
Resolving PR
lwasylow Apr 27, 2023
46ffe73
Update note
lwasylow Apr 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Changing to use Dijkstra algorithm to parse infix notation into postf…
…ix ( Reverse Polish Notation).

This allows us to more flexibility of using boolean expressions and not limited to flaky regex.
  • Loading branch information
lwasylow committed Apr 10, 2023
commit 20e317742e00f5299b2abd2675160d4b2cc38b86
4 changes: 0 additions & 4 deletions source/api/ut_runner.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ create or replace package body ut_runner is
ut_event_manager.trigger_event(ut_event_manager.gc_initialize);
ut_event_manager.trigger_event(ut_event_manager.gc_debug, ut_run_info());

if ut_utils.valid_tag_expression(l_tags) = 0 then
raise_application_error(ut_utils.gc_invalid_tag_expression, 'Invalid Tag expression');
end if;

if a_random_test_order_seed is not null then
l_random_test_order_seed := a_random_test_order_seed;
elsif a_random_test_order then
Expand Down
58 changes: 58 additions & 0 deletions source/core/types/ut_stack.tpb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
create or replace type body ut_stack as
/*
utPLSQL - Version 3
Copyright 2016 - 2021 utPLSQL Project

Licensed under the Apache License, Version 2.0 (the "License"):
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

constructor function ut_stack( self in out nocopy ut_stack) return self as result is
begin
self.tokens := ut_varchar2_list();
self.top := 0;
return;
end ut_stack;

member function peek(self in out nocopy ut_stack) return varchar2 is
l_token varchar2(32767);
begin
if self.tokens.count =0 or self.tokens is null then
l_token := null;
else
l_token := self.tokens(self.tokens.last);
end if;
return l_token;
end;

member procedure push(self in out nocopy ut_stack, a_token varchar2) is
begin
self.tokens.extend;
self.tokens(self.tokens.last) := a_token;
self.top := self.tokens.count;
end push;

member procedure pop(self in out nocopy ut_stack,a_cnt in integer default 1) is
begin
self.tokens.trim(a_cnt);
self.top := self.tokens.count;
end pop;

member function pop(self in out nocopy ut_stack) return varchar2 is
l_token varchar2(32767) := self.tokens(self.tokens.last);
begin
self.pop();
return l_token;
end;
end;
/

26 changes: 26 additions & 0 deletions source/core/types/ut_stack.tps
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
create or replace type ut_stack as object (
top integer,
tokens ut_varchar2_list,
/*
utPLSQL - Version 3
Copyright 2016 - 2021 utPLSQL Project

Licensed under the Apache License, Version 2.0 (the "License"):
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
constructor function ut_stack( self in out nocopy ut_stack) return self as result,
member function peek(self in out nocopy ut_stack) return varchar2,
member procedure push(self in out nocopy ut_stack, a_token varchar2),
member procedure pop(self in out nocopy ut_stack,a_cnt in integer default 1),
member function pop(self in out nocopy ut_stack) return varchar2
)

21 changes: 10 additions & 11 deletions source/core/ut_suite_cache_manager.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ create or replace package body ut_suite_cache_manager is
function replace_legacy_tag_notation(a_tags varchar2
) return varchar2 is
l_tags ut_varchar2_list := ut_utils.string_to_table(a_tags,',');
l_tags_include varchar2(2000);
l_tags_exclude varchar2(2000);
l_tags_include varchar2(4000);
l_tags_exclude varchar2(4000);
l_return_tag varchar2(4000);
begin
select listagg( t.column_value,' | ')
select listagg( t.column_value,'|')
within group( order by column_value)
into l_tags_include
from table(l_tags) t
Expand Down Expand Up @@ -268,15 +268,14 @@ create or replace package body ut_suite_cache_manager is
if instr(l_tags,',') > 0 or instr(l_tags,'-') > 0 then
l_tags := replace(replace_legacy_tag_notation(l_tags),' ');
end if;
l_tags := REGEXP_REPLACE(l_tags,
'(\(|\)|\||\!|\&)?([^|&!-()]+)(\(|\)|\||\!|\&)?',
q'[\1q'<\2>' member of tags\3]');
--replace operands to XPath
l_tags := ut_utils.convert_postfix_to_infix_where_sql(ut_utils.shunt_logical_expression(l_tags));
l_tags := REPLACE(l_tags, '|',' or ');
l_tags := REPLACE(l_tags , '&',' and ');
l_tags := REGEXP_REPLACE(l_tags,q'[(\!)(q'<[^|&!]+?>')( member of tags)]','\2 not \3');
l_tags := '('||l_tags||')';
return l_tags;
l_tags := REPLACE(l_tags ,'&',' and ');
l_tags := REPLACE(l_tags ,'!','not');
return l_tags;
exception
when ut_utils.ex_invalid_tag_expression then
raise_application_error(ut_utils.gc_invalid_tag_expression, 'Invalid Tag expression');
end;

/*
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy