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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixed tests failing due to NLS setting
  • Loading branch information
Pazus committed Oct 1, 2016
commit a80f6756e6c76fa1634e3708a15f95ba79c78ad1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ begin
dbms_output.put_line('expected an exception but nothing was raised' );
exception
when others then
if sqlerrm like '%PLS-00307: too many declarations of ''ARE_EQUAL'' match this call%' then
if sqlerrm like '%PLS-00307: % ''ARE_EQUAL'' %' then
:test_result := ut_utils.tr_success;
else
dbms_output.put_line( sqlerrm );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PROMPT Gives a failure when comparing different timestamp datatypes

@@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'
@@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'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PROMPT Gives a success when comparing equal timestamp datatypes

@@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'
@@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'
5 changes: 4 additions & 1 deletion tests/ut_utils/ut_utils.to_string.Timestamp.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ PROMPT Returns a full string representation of a timestamp with maximum precissi
--Arrange
declare
l_value timestamp(9) := to_timestamp('2016-12-31 23:59:59.123456789', 'yyyy-mm-dd hh24:mi:ss.ff');
l_expected varchar2(100) := '2016-12-31 23:59:59.123456789';
l_expected varchar2(100);
l_result varchar2(100);
l_delimiter varchar2(1);
begin
select substr(value, 1, 1) into l_delimiter from nls_session_parameters t where t.parameter = 'NLS_NUMERIC_CHARACTERS';
l_expected := '2016-12-31 23:59:59'||l_delimiter||'123456789';
--Act
l_result := ut_utils.to_String(l_value);
--Assert
Expand Down
5 changes: 5 additions & 0 deletions tests/ut_utils/ut_utils.to_string.verySmallNumber.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ declare
l_value number := 0.123456789012345678901234567890123456789;
l_expected varchar2(100) := '.123456789012345678901234567890123456789';
l_result varchar2(100);
l_delimiter varchar2(1);
begin
--Act
select substr(value, 1, 1) into l_delimiter from nls_session_parameters t where t.parameter = 'NLS_NUMERIC_CHARACTERS';
l_expected := l_delimiter||'123456789012345678901234567890123456789';

l_result := ut_utils.to_String(l_value);

--Assert
if l_result = l_expected then
:test_result := ut_utils.tr_success;
Expand Down