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

Skip to content

Commit 534545d

Browse files
committed
fixed lpad determination
1 parent 6fcff0e commit 534545d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

source/reporters/ut_documentation_reporter.tpb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ create or replace type body ut_documentation_reporter is
8686
overriding member procedure after_calling_run(self in out nocopy ut_documentation_reporter, a_run in ut_run) as
8787
l_summary_text varchar2(4000);
8888
l_warning_index pls_integer := 0;
89-
l_warnings_lpad integer;
89+
-- make all warning indexes uniformly indented
90+
c_warnings_lpad constant integer := length(to_char(a_run.results_count.warnings_count));
9091

9192
procedure print_failure_for_expectation(a_expectation ut_expectation_result) is
9293
l_lines ut_varchar2_list;
@@ -155,7 +156,7 @@ create or replace type body ut_documentation_reporter is
155156
if a_item.warnings is not null and a_item.warnings.count > 0 then
156157
for i in 1 .. a_item.warnings.count loop
157158
l_warning_index := l_warning_index + 1;
158-
self.print_text(' ' || lpad(l_warning_index, l_warnings_lpad) || ') ' || a_item.path);
159+
self.print_text(' ' || lpad(l_warning_index, c_warnings_lpad) || ') ' || a_item.path);
159160
self.lvl := self.lvl + 3;
160161
self.print_red_text(a_item.warnings(i));
161162
self.lvl := self.lvl - 3;
@@ -182,9 +183,6 @@ create or replace type body ut_documentation_reporter is
182183
print_warnings(a_run);
183184
self.print_text('Finished in ' || a_run.execution_time || ' seconds');
184185

185-
-- make all warning indexes uniformly indented
186-
l_warnings_lpad := length(to_char(a_run.results_count.warnings_count));
187-
188186
l_summary_text :=
189187
a_run.results_count.total_count || ' tests, '
190188
|| a_run.results_count.failure_count || ' failed, ' || a_run.results_count.errored_count || ' errored, '

0 commit comments

Comments
 (0)