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

Skip to content

Commit caeeb30

Browse files
committed
Adding contain and not contain
1 parent 13d86b6 commit caeeb30

2 files changed

Lines changed: 25 additions & 21 deletions

File tree

source/expectations/ut_expectation_compound.tpb

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,32 +66,36 @@ create or replace type body ut_expectation_compound as
6666
return treat(l_result as ut_equal);
6767
end;
6868

69-
member function to_contain(a_expected sys_refcursor) return ut_expectation_compound is
70-
l_result ut_expectation_compound := self;
69+
member function to_contain(a_expected sys_refcursor) return ut_equal is
70+
l_result ut_matcher;
7171
begin
72-
l_result.matcher := ut_contain(a_expected);
73-
return l_result;
72+
l_result := ut_contain(a_expected);
73+
l_result.expectation := self;
74+
return treat(l_result as ut_equal);
7475
end;
7576

76-
member function not_to_contain(a_expected sys_refcursor) return ut_expectation_compound is
77-
l_result ut_expectation_compound := self;
77+
member function not_to_contain(a_expected sys_refcursor) return ut_equal is
78+
l_result ut_matcher;
7879
begin
79-
l_result.matcher := ut_contain(a_expected).negated();
80-
return l_result;
80+
l_result := ut_contain(a_expected).negated();
81+
l_result.expectation := self;
82+
return treat(l_result as ut_equal);
8183
end;
82-
83-
member function to_contain(a_expected anydata) return ut_expectation_compound is
84-
l_result ut_expectation_compound := self;
84+
85+
member function to_contain(a_expected anydata) return ut_equal is
86+
l_result ut_matcher;
8587
begin
86-
l_result.matcher := ut_contain(a_expected);
87-
return l_result;
88+
l_result := ut_contain(a_expected);
89+
l_result.expectation := self;
90+
return treat(l_result as ut_equal);
8891
end;
8992

90-
member function not_to_contain(a_expected anydata) return ut_expectation_compound is
91-
l_result ut_expectation_compound := self;
93+
member function not_to_contain(a_expected anydata) return ut_equal is
94+
l_result ut_matcher;
9295
begin
93-
l_result.matcher := ut_contain(a_expected).negated();
94-
return l_result;
96+
l_result := ut_contain(a_expected).negated();
97+
l_result.expectation := self;
98+
return treat(l_result as ut_equal);
9599
end;
96100

97101
end;

source/expectations/ut_expectation_compound.tps

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ create or replace type ut_expectation_compound under ut_expectation(
2626
member function not_to_equal(a_expected anydata, a_nulls_are_equal boolean := null) return ut_equal,
2727
member function to_equal(a_expected sys_refcursor, a_nulls_are_equal boolean := null) return ut_equal,
2828
member function not_to_equal(a_expected sys_refcursor, a_nulls_are_equal boolean := null) return ut_equal,
29-
member function to_contain(a_expected sys_refcursor) return ut_expectation_compound,
30-
member function not_to_contain(a_expected sys_refcursor) return ut_expectation_compound,
31-
member function to_contain(a_expected anydata) return ut_expectation_compound,
32-
member function not_to_contain(a_expected anydata) return ut_expectation_compound
29+
member function to_contain(a_expected sys_refcursor) return ut_equal,
30+
member function not_to_contain(a_expected sys_refcursor) return ut_equal,
31+
member function to_contain(a_expected anydata) return ut_equal,
32+
member function not_to_contain(a_expected anydata) return ut_equal
3333
)
3434
/
3535

0 commit comments

Comments
 (0)