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

Skip to content

Commit 3ad5e02

Browse files
committed
Fixed tests failing due to NLS setting
1 parent b82136a commit 3ad5e02

5 files changed

Lines changed: 12 additions & 4 deletions

tests/ut_assert/ut_assert.are_equal.scalar.FailsToExecuteWhenNullsPassedAsParameters.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ begin
44
dbms_output.put_line('expected an exception but nothing was raised' );
55
exception
66
when others then
7-
if sqlerrm like '%PLS-00307: too many declarations of ''ARE_EQUAL'' match this call%' then
7+
if sqlerrm like '%PLS-00307: % ''ARE_EQUAL'' %' then
88
:test_result := ut_utils.tr_success;
99
else
1010
dbms_output.put_line( sqlerrm );
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
PROMPT Gives a failure when comparing different timestamp datatypes
22

3-
@@ut_assert/common/ut_assert.are_equal.scalar.common.sql 'timestamp(9)' 'to_Timestamp(''2016-09-06 22:36:11.123456789'',''yyyy-mm-dd hh24:mi:ss.xff'')' 'to_Timestamp(''2016-09-06 22:36:11.123456788'',''yyyy-mm-dd hh24:mi:ss.xff'')' 'ut_utils.tr_failure'
3+
@@ut_assert/common/ut_assert.are_equal.scalar.common.sql 'timestamp(9)' 'to_Timestamp(''2016-09-06 22:36:11.123456789'',''yyyy-mm-dd hh24:mi:ss.ff'')' 'to_Timestamp(''2016-09-06 22:36:11.123456788'',''yyyy-mm-dd hh24:mi:ss.ff'')' 'ut_utils.tr_failure'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
PROMPT Gives a success when comparing equal timestamp datatypes
22

3-
@@ut_assert/common/ut_assert.are_equal.scalar.common.sql 'timestamp(9)' 'to_Timestamp(''2016-09-06 22:36:11.123456789'',''yyyy-mm-dd hh24:mi:ss.xff'')' 'to_Timestamp(''2016-09-06 22:36:11.123456789'',''yyyy-mm-dd hh24:mi:ss.xff'')' 'ut_utils.tr_success'
3+
@@ut_assert/common/ut_assert.are_equal.scalar.common.sql 'timestamp(9)' 'to_Timestamp(''2016-09-06 22:36:11.123456789'',''yyyy-mm-dd hh24:mi:ss.ff'')' 'to_Timestamp(''2016-09-06 22:36:11.123456789'',''yyyy-mm-dd hh24:mi:ss.ff'')' 'ut_utils.tr_success'

tests/ut_utils/ut_utils.to_string.Timestamp.sql

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ PROMPT Returns a full string representation of a timestamp with maximum precissi
33
--Arrange
44
declare
55
l_value timestamp(9) := to_timestamp('2016-12-31 23:59:59.123456789', 'yyyy-mm-dd hh24:mi:ss.ff');
6-
l_expected varchar2(100) := '2016-12-31 23:59:59.123456789';
6+
l_expected varchar2(100);
77
l_result varchar2(100);
8+
l_delimiter varchar2(1);
89
begin
10+
select substr(value, 1, 1) into l_delimiter from nls_session_parameters t where t.parameter = 'NLS_NUMERIC_CHARACTERS';
11+
l_expected := '2016-12-31 23:59:59'||l_delimiter||'123456789';
912
--Act
1013
l_result := ut_utils.to_String(l_value);
1114
--Assert

tests/ut_utils/ut_utils.to_string.verySmallNumber.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ declare
55
l_value number := 0.123456789012345678901234567890123456789;
66
l_expected varchar2(100) := '.123456789012345678901234567890123456789';
77
l_result varchar2(100);
8+
l_delimiter varchar2(1);
89
begin
910
--Act
11+
select substr(value, 1, 1) into l_delimiter from nls_session_parameters t where t.parameter = 'NLS_NUMERIC_CHARACTERS';
12+
l_expected := l_delimiter||'123456789012345678901234567890123456789';
13+
1014
l_result := ut_utils.to_String(l_value);
15+
1116
--Assert
1217
if l_result = l_expected then
1318
:test_result := ut_utils.tr_success;

0 commit comments

Comments
 (0)