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

Skip to content

Commit 7ddbacc

Browse files
committed
Added tests for contexts and suites
1 parent 707fadd commit 7ddbacc

2 files changed

Lines changed: 39 additions & 3 deletions

File tree

test/ut3_user/reporters/test_tap_reporter.pkb

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ create or replace package body test_tap_reporter as
159159
end escape_multiple_characters_test_name;
160160

161161

162-
procedure special_characters_in_deisabled_reason as
162+
procedure special_characters_in_disabled_reason as
163163
l_output_data ut3_develop.ut_varchar2_list;
164164
l_expected varchar2(32767);
165165
begin
@@ -170,7 +170,7 @@ create or replace package body test_tap_reporter as
170170
from table(ut3_develop.ut.run('test_tap_escaping.not_skipping_escapes',ut3_develop.ut_tap_reporter()));
171171

172172
ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_be_like(l_expected);
173-
end special_characters_in_deisabled_reason;
173+
end special_characters_in_disabled_reason;
174174

175175

176176
procedure special_characters_in_comment as
@@ -187,6 +187,36 @@ create or replace package body test_tap_reporter as
187187
end special_characters_in_comment;
188188

189189

190+
procedure context_as_commented_subtests as
191+
l_output_data ut3_develop.ut_varchar2_list;
192+
l_expected varchar2(32767);
193+
begin
194+
l_expected := q'[%# Subtest: A suite for testing different outcomes from reporters%# Subtest: A description of some context%]';
195+
196+
select *
197+
bulk collect into l_output_data
198+
from table(ut3_develop.ut.run('test_reporters.passing_test',ut3_develop.ut_tap_reporter()));
199+
200+
ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_be_like(l_expected);
201+
202+
end context_as_commented_subtests;
203+
204+
205+
procedure suitepath_as_chopped_subtests as
206+
l_output_data ut3_develop.ut_varchar2_list;
207+
l_expected varchar2(32767);
208+
begin
209+
l_expected := q'[.*# Subtest: org.*1\s{5}# Subtest: utplsql.*1\s{9}# Subtest: tests.*1\s{13}# Subtest: helpers.*1\s{17}# Subtest: A suite for testing different outcomes from reporters.*]';
210+
211+
select *
212+
bulk collect into l_output_data
213+
from table(ut3_develop.ut.run('test_reporters.passing_test',ut3_develop.ut_tap_reporter()));
214+
215+
ut.expect(ut3_tester_helper.main_helper.table_to_clob(l_output_data)).to_match(l_expected, 'n');
216+
217+
end suitepath_as_chopped_subtests;
218+
219+
190220
procedure drop_help_tests as
191221
pragma autonomous_transaction;
192222
begin

test/ut3_user/reporters/test_tap_reporter.pks

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ create or replace package test_tap_reporter as
3131
procedure escape_multiple_characters_test_name;
3232

3333
--%test(Disabled Test with special characters in disable reason)
34-
procedure special_characters_in_deisabled_reason;
34+
procedure special_characters_in_disabled_reason;
3535

3636
--%test(Don't escape special characters in comment)
3737
procedure special_characters_in_comment;
3838

39+
--%test(Include context as commented subtests)
40+
procedure context_as_commented_subtests;
41+
42+
--%test(Suitepath as chopped subtests)
43+
procedure suitepath_as_chopped_subtests;
44+
3945

4046
--%afterall
4147
procedure drop_help_tests;

0 commit comments

Comments
 (0)