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

Skip to content
Merged
Changes from 1 commit
Commits
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
fixed lpad determination
  • Loading branch information
Pazus committed Jul 1, 2017
commit 534545db746dee55d65b232071d34396c70acc9c
8 changes: 3 additions & 5 deletions source/reporters/ut_documentation_reporter.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ create or replace type body ut_documentation_reporter is
overriding member procedure after_calling_run(self in out nocopy ut_documentation_reporter, a_run in ut_run) as
l_summary_text varchar2(4000);
l_warning_index pls_integer := 0;
l_warnings_lpad integer;
-- make all warning indexes uniformly indented
c_warnings_lpad constant integer := length(to_char(a_run.results_count.warnings_count));

procedure print_failure_for_expectation(a_expectation ut_expectation_result) is
l_lines ut_varchar2_list;
Expand Down Expand Up @@ -155,7 +156,7 @@ create or replace type body ut_documentation_reporter is
if a_item.warnings is not null and a_item.warnings.count > 0 then
for i in 1 .. a_item.warnings.count loop
l_warning_index := l_warning_index + 1;
self.print_text(' ' || lpad(l_warning_index, l_warnings_lpad) || ') ' || a_item.path);
self.print_text(' ' || lpad(l_warning_index, c_warnings_lpad) || ') ' || a_item.path);
self.lvl := self.lvl + 3;
self.print_red_text(a_item.warnings(i));
self.lvl := self.lvl - 3;
Expand All @@ -182,9 +183,6 @@ create or replace type body ut_documentation_reporter is
print_warnings(a_run);
self.print_text('Finished in ' || a_run.execution_time || ' seconds');

-- make all warning indexes uniformly indented
l_warnings_lpad := length(to_char(a_run.results_count.warnings_count));

l_summary_text :=
a_run.results_count.total_count || ' tests, '
|| a_run.results_count.failure_count || ' failed, ' || a_run.results_count.errored_count || ' errored, '
Expand Down