From cb190e17e0f6ccfc778bf460ba75cf57ce9a8d67 Mon Sep 17 00:00:00 2001 From: Pazus Date: Mon, 16 Jan 2017 23:41:23 +0300 Subject: [PATCH 1/2] address #160 --- source/core/types/ut_assert_result.tpb | 6 +++--- source/expectations/matchers/ut_be_between.tpb | 2 +- source/expectations/matchers/ut_be_false.tpb | 2 +- source/expectations/matchers/ut_be_greater_or_equal.tpb | 2 +- source/expectations/matchers/ut_be_greater_than.tpb | 2 +- source/expectations/matchers/ut_be_less_or_equal.tpb | 2 +- source/expectations/matchers/ut_be_less_than.tpb | 2 +- source/expectations/matchers/ut_be_like.tpb | 2 +- source/expectations/matchers/ut_be_not_null.tpb | 2 +- source/expectations/matchers/ut_be_null.tpb | 2 +- source/expectations/matchers/ut_be_true.tpb | 2 +- source/expectations/matchers/ut_equal.tpb | 2 +- source/expectations/matchers/ut_match.tpb | 2 +- 13 files changed, 15 insertions(+), 15 deletions(-) diff --git a/source/core/types/ut_assert_result.tpb b/source/core/types/ut_assert_result.tpb index 7dfcd1c78..0f6bd86b4 100644 --- a/source/core/types/ut_assert_result.tpb +++ b/source/core/types/ut_assert_result.tpb @@ -59,13 +59,13 @@ create or replace type body ut_assert_result is if self.result != ut_utils.tr_success then if self.actual_value_string is not null or self.actual_type is not null then - l_actual_val_msg := ' expected (actual value): '; + l_actual_val_msg := ' expected this: '; l_actual_val := self.actual_value_string || '(' || self.actual_type || ')'; end if; - l_expected_msg := ' '||self.matcher_name || self.additional_info; + l_expected_msg := ' ' || self.matcher_name || self.additional_info; if self.expected_value_string is not null or self.expected_type is not null then - l_expected_msg := l_expected_msg || ' (expected value): '; + l_expected_msg := l_expected_msg || ' this: '; l_expected_val := self.expected_value_string||'('||self.expected_type||')'; if length(l_expected_msg) > length(l_actual_val_msg) then l_actual_val_msg := rpad(l_actual_val_msg , length(l_expected_msg)); diff --git a/source/expectations/matchers/ut_be_between.tpb b/source/expectations/matchers/ut_be_between.tpb index bb9023c35..3af9a4faf 100644 --- a/source/expectations/matchers/ut_be_between.tpb +++ b/source/expectations/matchers/ut_be_between.tpb @@ -2,7 +2,7 @@ create or replace type body ut_be_between is member procedure init(self in out nocopy ut_be_between, a_lower_bound ut_data_value, a_upper_bound ut_data_value) is begin - self.name := lower($$plsql_unit); + self.name := 'be between'; self.lower_bound := a_lower_bound; self.upper_bound := a_upper_bound; self.additional_info := 'between ' || a_lower_bound.to_string || ' and ' || a_upper_bound.to_string; diff --git a/source/expectations/matchers/ut_be_false.tpb b/source/expectations/matchers/ut_be_false.tpb index 1e5cc65d4..016d89c31 100644 --- a/source/expectations/matchers/ut_be_false.tpb +++ b/source/expectations/matchers/ut_be_false.tpb @@ -2,7 +2,7 @@ create or replace type body ut_be_false as constructor function ut_be_false(self in out nocopy ut_be_false) return self as result is begin - self.name := lower($$plsql_unit); + self.name := 'be false'; return; end; diff --git a/source/expectations/matchers/ut_be_greater_or_equal.tpb b/source/expectations/matchers/ut_be_greater_or_equal.tpb index cccdb626f..681c7e2b2 100644 --- a/source/expectations/matchers/ut_be_greater_or_equal.tpb +++ b/source/expectations/matchers/ut_be_greater_or_equal.tpb @@ -2,7 +2,7 @@ create or replace type body ut_be_greater_or_equal AS member procedure init(self in out nocopy ut_be_greater_or_equal, a_expected ut_data_value) is begin - self.name := lower($$plsql_unit); + self.name := 'be greater or equal'; self.expected := a_expected; end; diff --git a/source/expectations/matchers/ut_be_greater_than.tpb b/source/expectations/matchers/ut_be_greater_than.tpb index 0cbfb90de..d084b9a4e 100644 --- a/source/expectations/matchers/ut_be_greater_than.tpb +++ b/source/expectations/matchers/ut_be_greater_than.tpb @@ -2,7 +2,7 @@ create or replace type body ut_be_greater_than AS member procedure init(self in out nocopy ut_be_greater_than, a_expected ut_data_value) is begin - self.name := lower($$plsql_unit); + self.name := 'be greater than'; self.expected := a_expected; end; diff --git a/source/expectations/matchers/ut_be_less_or_equal.tpb b/source/expectations/matchers/ut_be_less_or_equal.tpb index f62bca27d..c20ca50e6 100644 --- a/source/expectations/matchers/ut_be_less_or_equal.tpb +++ b/source/expectations/matchers/ut_be_less_or_equal.tpb @@ -2,7 +2,7 @@ create or replace type body ut_be_less_or_equal AS member procedure init(self in out nocopy ut_be_less_or_equal, a_expected ut_data_value) is begin - self.name := lower($$plsql_unit); + self.name := 'be less or equal'; self.expected := a_expected; end; diff --git a/source/expectations/matchers/ut_be_less_than.tpb b/source/expectations/matchers/ut_be_less_than.tpb index 1202f1017..ccf85572e 100644 --- a/source/expectations/matchers/ut_be_less_than.tpb +++ b/source/expectations/matchers/ut_be_less_than.tpb @@ -2,7 +2,7 @@ create or replace type body ut_be_less_than as member procedure init(self in out nocopy ut_be_less_than, a_expected ut_data_value) is begin - self.name := lower($$plsql_unit); + self.name := 'be less than'; self.expected := a_expected; end; diff --git a/source/expectations/matchers/ut_be_like.tpb b/source/expectations/matchers/ut_be_like.tpb index ae684980f..9cb0b07a7 100644 --- a/source/expectations/matchers/ut_be_like.tpb +++ b/source/expectations/matchers/ut_be_like.tpb @@ -8,7 +8,7 @@ create or replace type body ut_be_like as self.additional_info := self.additional_info ||' escape '''||a_escape_char||''''; end if; end if; - self.name := lower($$plsql_unit); + self.name := 'be like'; self.mask := a_mask; self.escape_char := a_escape_char; return; diff --git a/source/expectations/matchers/ut_be_not_null.tpb b/source/expectations/matchers/ut_be_not_null.tpb index 239d61803..166fc585a 100644 --- a/source/expectations/matchers/ut_be_not_null.tpb +++ b/source/expectations/matchers/ut_be_not_null.tpb @@ -2,7 +2,7 @@ create or replace type body ut_be_not_null as constructor function ut_be_not_null(self in out nocopy ut_be_not_null) return self as result is begin - self.name := lower($$plsql_unit); + self.name := 'be not null'; return; end; diff --git a/source/expectations/matchers/ut_be_null.tpb b/source/expectations/matchers/ut_be_null.tpb index bfba92edb..528dcc905 100644 --- a/source/expectations/matchers/ut_be_null.tpb +++ b/source/expectations/matchers/ut_be_null.tpb @@ -2,7 +2,7 @@ create or replace type body ut_be_null as constructor function ut_be_null(self in out nocopy ut_be_null) return self as result is begin - self.name := lower($$plsql_unit); + self.name := 'be null'; return; end; diff --git a/source/expectations/matchers/ut_be_true.tpb b/source/expectations/matchers/ut_be_true.tpb index 335daeeab..f3b2d640d 100644 --- a/source/expectations/matchers/ut_be_true.tpb +++ b/source/expectations/matchers/ut_be_true.tpb @@ -2,7 +2,7 @@ create or replace type body ut_be_true as constructor function ut_be_true(self in out nocopy ut_be_true) return self as result is begin - self.name := lower($$plsql_unit); + self.name := 'be true'; return; end; diff --git a/source/expectations/matchers/ut_equal.tpb b/source/expectations/matchers/ut_equal.tpb index 1a666f71c..1c2da8374 100644 --- a/source/expectations/matchers/ut_equal.tpb +++ b/source/expectations/matchers/ut_equal.tpb @@ -3,7 +3,7 @@ create or replace type body ut_equal as member procedure init(self in out nocopy ut_equal, a_expected ut_data_value, a_nulls_are_equal boolean) is begin self.nulls_are_equal_flag := ut_utils.boolean_to_int( coalesce(a_nulls_are_equal, ut_assert_processor.nulls_are_equal()) ); - self.name := lower($$plsql_unit); + self.name := 'equal'; self.expected := a_expected; end; diff --git a/source/expectations/matchers/ut_match.tpb b/source/expectations/matchers/ut_match.tpb index 8ce46f73c..25197cf28 100644 --- a/source/expectations/matchers/ut_match.tpb +++ b/source/expectations/matchers/ut_match.tpb @@ -8,7 +8,7 @@ create or replace type body ut_match as self.additional_info := self.additional_info ||', modifiers '''||a_modifiers||''''; end if; end if; - self.name := lower($$plsql_unit); + self.name := 'match'; self.pattern := a_pattern; self.modifiers := a_modifiers; return; From f29bbf55f917027fd0dab69d55bcf72e03fd6992 Mon Sep 17 00:00:00 2001 From: Pazus Date: Tue, 17 Jan 2017 08:10:00 +0300 Subject: [PATCH 2/2] removed "this" from expected message --- source/core/types/ut_assert_result.tpb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/core/types/ut_assert_result.tpb b/source/core/types/ut_assert_result.tpb index 0f6bd86b4..036438be5 100644 --- a/source/core/types/ut_assert_result.tpb +++ b/source/core/types/ut_assert_result.tpb @@ -65,7 +65,7 @@ create or replace type body ut_assert_result is l_expected_msg := ' ' || self.matcher_name || self.additional_info; if self.expected_value_string is not null or self.expected_type is not null then - l_expected_msg := l_expected_msg || ' this: '; + l_expected_msg := l_expected_msg || ': '; l_expected_val := self.expected_value_string||'('||self.expected_type||')'; if length(l_expected_msg) > length(l_actual_val_msg) then l_actual_val_msg := rpad(l_actual_val_msg , length(l_expected_msg));