@@ -16,41 +16,24 @@ create or replace type body ut_be_within as
1616 limitations under the License.
1717 */
1818
19- member procedure init(self in out nocopy ut_be_within, a_distance_from_expected ut_data_value) is
20- begin
21- self.distance_from_expected := a_distance_from_expected;
22- self.self_type := $$plsql_unit;
23- end;
24-
2519 constructor function ut_be_within(self in out nocopy ut_be_within, a_distance_from_expected number) return self as result is
2620 begin
27- init(ut_data_value_number(a_distance_from_expected));
21+ self. init(ut_data_value_number(a_distance_from_expected), $$plsql_unit );
2822 return;
2923 end;
3024
3125 constructor function ut_be_within(self in out nocopy ut_be_within, a_distance_from_expected dsinterval_unconstrained) return self as result is
3226 begin
33- init(ut_data_value_dsinterval(a_distance_from_expected));
27+ self. init(ut_data_value_dsinterval(a_distance_from_expected), $$plsql_unit );
3428 return;
3529 end;
36-
30+
3731 constructor function ut_be_within(self in out nocopy ut_be_within, a_distance_from_expected yminterval_unconstrained) return self as result is
3832 begin
39- init(ut_data_value_yminterval(a_distance_from_expected));
33+ self. init(ut_data_value_yminterval(a_distance_from_expected), $$plsql_unit );
4034 return;
4135 end;
4236
43- member procedure of_(self in ut_be_within, a_expected number) is
44- l_result ut_be_within := self;
45- begin
46- l_result.expected := ut_data_value_number(a_expected);
47- if l_result.is_negated_flag = 1 then
48- l_result.expectation.not_to(l_result );
49- else
50- l_result.expectation.to_(l_result );
51- end if;
52- end;
53-
5437 member procedure of_(self in ut_be_within, a_expected date) is
5538 l_result ut_be_within := self;
5639 begin
@@ -62,13 +45,6 @@ create or replace type body ut_be_within as
6245 end if;
6346 end;
6447
65- member function of_(self in ut_be_within, a_expected number) return ut_be_within is
66- l_result ut_be_within := self;
67- begin
68- l_result.expected := ut_data_value_number(a_expected);
69- return l_result;
70- end;
71-
7248 member function of_(self in ut_be_within, a_expected date) return ut_be_within is
7349 l_result ut_be_within := self;
7450 begin
@@ -96,7 +72,7 @@ create or replace type body ut_be_within as
9672 then treat(self.distance_from_expected as ut_data_value_dsinterval).data_value
9773 end;
9874 begin
99- return case when l_distance_ym is not null
75+ return case when l_distance_ym is not null
10076 then l_actual between l_expected - l_distance_ym and l_expected + l_distance_ym
10177 else l_actual between l_expected - l_distance_ds and l_expected + l_distance_ds
10278 end;
@@ -116,15 +92,14 @@ create or replace type body ut_be_within as
11692 end;
11793
11894 overriding member function failure_message(a_actual ut_data_value) return varchar2 is
119- begin
95+ begin
12096 return (self as ut_matcher).failure_message(a_actual) || ' '||self.distance_from_expected.to_string ||' of '|| expected.to_string_report();
12197 end;
12298
12399 overriding member function failure_message_when_negated(a_actual ut_data_value) return varchar2 is
124- l_result varchar2(32767);
125- begin
100+ begin
126101 return (self as ut_matcher).failure_message_when_negated(a_actual) || ' '||self.distance_from_expected.to_string ||' of '|| expected.to_string_report();
127- end;
128-
102+ end;
103+
129104end;
130105/
0 commit comments