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

Skip to content

Commit 0b03770

Browse files
committed
Fixed inconsistency with ANYDATA, where matcher was not failing with error when comparing different datatypes.
1 parent 4185a37 commit 0b03770

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

source/expectations/data_values/ut_data_value_anydata.tpb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ create or replace type body ut_data_value_anydata as
33
constructor function ut_data_value_anydata(self in out nocopy ut_data_value_anydata, a_value anydata) return self as result is
44
begin
55
self.datavalue := a_value;
6-
self.datatype := a_value.gettypename;
6+
self.datatype := lower(a_value.gettypename);
77
return;
88
end;
99

source/expectations/matchers/equal.tpb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ create or replace type body equal as
9494
overriding member function run_matcher(self in out nocopy equal, a_actual ut_data_value) return boolean is
9595
l_result boolean;
9696
begin
97-
if self.expected is of (ut_data_value_anydata) and a_actual is of (ut_data_value_anydata) then
97+
if self.expected is of (ut_data_value_anydata) and a_actual is of (ut_data_value_anydata)
98+
--anydata can hold many different data types
99+
and self.expected.datatype = a_actual.datatype then
98100
declare
99101
l_expected ut_data_value_anydata := treat(self.expected as ut_data_value_anydata);
100102
l_actual ut_data_value_anydata := treat(a_actual as ut_data_value_anydata);

0 commit comments

Comments
 (0)