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

Skip to content

Commit b72ffd3

Browse files
committed
Changes multi-byte character in the tests to be of UTF8 type (♠ - emoji)
1 parent 61ab8f0 commit b72ffd3

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

test/ut_utils/test_ut_utils.pkb

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -53,33 +53,33 @@ end;]' using p_expected_list;
5353
common_clob_to_table_exec( 'abcdefg,hijk,axa,a', ',', ut3.ut_varchar2_list('abc','def','g','hij','k','axa','a'), 3);
5454
common_clob_to_table_exec( ',a,,c,d,', ',', ut3.ut_varchar2_list('','a','','c','d',''), 1000);
5555
end;
56-
56+
5757
procedure test_to_char is
5858
begin
5959
ut.expect(ut3.ut_utils.test_result_to_char(-1),'test unknown').to_equal('Unknown(-1)');
6060
ut.expect(ut3.ut_utils.test_result_to_char(null),'test unknown').to_equal('Unknown(NULL)');
6161
ut.expect(ut3.ut_utils.test_result_to_char(ut3.ut_utils.tr_success),'test unknown').to_equal(ut3.ut_utils.tr_success_char);
6262
end;
63-
63+
6464
procedure test_to_string_blob is
6565
l_text varchar2(32767) := 'A test char';
6666
l_value blob := utl_raw.cast_to_raw(l_text);
67-
l_expected varchar2(32767) := ''''||rawtohex(l_value)||'''';
67+
l_expected varchar2(32767) := ''''||rawtohex(l_value)||'''';
6868
l_result varchar2(32767);
6969
begin
7070
l_result := ut3.ut_utils.to_String(l_value);
7171
ut.expect(l_result).to_equal(l_expected);
7272
end;
73-
73+
7474
procedure test_to_string_clob is
7575
l_value clob := 'A test char';
7676
l_expected varchar2(32767) := ''''||l_value||'''';
7777
l_result varchar2(32767);
7878
begin
7979
l_result := ut3.ut_utils.to_String(l_value);
8080
ut.expect(l_result).to_equal(l_expected);
81-
end;
82-
81+
end;
82+
8383
procedure test_to_string_date is
8484
l_value date := to_date('2016-12-31 23:59:59', 'yyyy-mm-dd hh24:mi:ss');
8585
l_expected varchar2(100) := '2016-12-31T23:59:59';
@@ -88,7 +88,7 @@ end;]' using p_expected_list;
8888
l_result := ut3.ut_utils.to_String(l_value);
8989
ut.expect(l_result).to_equal(l_expected);
9090
end;
91-
91+
9292
procedure to_string_null is
9393
begin
9494
ut.expect(ut3.ut_utils.to_String(to_blob(NULL))).to_equal('NULL');
@@ -97,7 +97,7 @@ end;]' using p_expected_list;
9797
ut.expect(ut3.ut_utils.to_String(to_number(NULL))).to_equal('NULL');
9898
ut.expect(ut3.ut_utils.to_String(to_timestamp(NULL))).to_equal('NULL');
9999
end;
100-
100+
101101
procedure to_string is
102102
l_value timestamp(9) := to_timestamp('2016-12-31 23:59:59.123456789', 'yyyy-mm-dd hh24:mi:ss.ff');
103103
l_value2 timestamp(9) with local time zone:= to_timestamp('2016-12-31 23:59:59.123456789', 'yyyy-mm-dd hh24:mi:ss.ff');
@@ -109,25 +109,25 @@ end;]' using p_expected_list;
109109
begin
110110
select substr(value, 1, 1) into l_delimiter from nls_session_parameters t where t.parameter = 'NLS_NUMERIC_CHARACTERS';
111111
l_expected := '2016-12-31T23:59:59'||l_delimiter||'123456789';
112-
112+
113113
l_result := ut3.ut_utils.to_String(l_value);
114114
ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected);
115-
115+
116116
l_expected := '2016-12-31T23:59:59'||l_delimiter||'123456789';
117117
l_result := ut3.ut_utils.to_String(l_value2);
118-
ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected);
118+
ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected);
119119

120120
l_expected := '2016-12-31T23:59:59'||l_delimiter||'123456789 -08:00';
121-
121+
122122
l_result := ut3.ut_utils.to_String(l_value3);
123-
ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected);
124-
125-
l_expected := ''''||l_value4||'''';
123+
ut.expect(l_result,'Returns a full string representation of a timestamp with maximum precission').to_equal(l_expected);
124+
125+
l_expected := ''''||l_value4||'''';
126126
l_result := ut3.ut_utils.to_String(l_value4);
127-
ut.expect(l_result,'Returns a varchar2 eclosed in quotes').to_equal(l_expected);
128-
127+
ut.expect(l_result,'Returns a varchar2 eclosed in quotes').to_equal(l_expected);
128+
129129
end;
130-
130+
131131
procedure to_string_big_blob is
132132
l_text clob := lpad('A test char',32767,'1')||lpad('1',32767,'1');
133133
l_value blob;
@@ -162,7 +162,7 @@ end;]' using p_expected_list;
162162
ut.EXPECT(l_result).to_be_like('%'||ut3.ut_utils.gc_more_data_string);
163163

164164
end;
165-
165+
166166
procedure to_string_big_clob is
167167
l_value clob := lpad('A test char',32767,'1')||lpad('1',32767,'1');
168168
l_result varchar2(32767);
@@ -173,7 +173,7 @@ end;]' using p_expected_list;
173173
ut.EXPECT(length(l_result)).to_equal(ut3.ut_utils.gc_max_output_string_length);
174174
ut.EXPECT(l_result).to_be_like('%'||ut3.ut_utils.gc_more_data_string);
175175
end;
176-
176+
177177
procedure to_string_big_number is
178178
l_value number := 1234567890123456789012345678901234567890;
179179
l_expected varchar2(100) := '1234567890123456789012345678901234567890';
@@ -184,7 +184,7 @@ end;]' using p_expected_list;
184184
--Assert
185185
ut.expect(l_result).TO_equal(l_expected);
186186
end;
187-
187+
188188
procedure to_string_big_varchar2 is
189189
l_value varchar2(32767) := lpad('A test char',32767,'1');
190190
l_result varchar2(32767);
@@ -205,20 +205,20 @@ end;]' using p_expected_list;
205205
--Act
206206
select substr(value, 1, 1) into l_delimiter from nls_session_parameters t where t.parameter = 'NLS_NUMERIC_CHARACTERS';
207207
l_expected := l_delimiter||'123456789012345678901234567890123456789';
208-
208+
209209
l_result := ut3.ut_utils.to_String(l_value);
210-
210+
211211
--Assert
212212
ut.expect(l_result).TO_equal(l_expected);
213213

214214
end;
215-
215+
216216
procedure test_table_to_clob is
217217
procedure exec_table_to_clob(a_list ut3.ut_varchar2_list, a_delimiter varchar2, a_expected clob) is
218218
l_result clob;
219219
begin
220220
l_result := ut3.ut_utils.table_to_clob(a_list, a_delimiter);
221-
221+
222222
ut.expect(l_result).to_equal(a_expected, a_nulls_are_equal => true);
223223
end;
224224
begin
@@ -254,7 +254,7 @@ end;]' using p_expected_list;
254254
select value into gv_nls_value from nls_session_parameters where parameter = 'NLS_DATE_LANGUAGE';
255255
execute immediate 'alter session set nls_date_language=ENGLISH';
256256
execute immediate 'create or replace package tst_chars as
257-
-- 2) Status of the process = �PE� with no linked data
257+
-- 2) Status of the process = �PE� with no linked data
258258
end;';
259259
execute immediate 'alter session set nls_date_language=RUSSIAN';
260260

@@ -265,12 +265,12 @@ end;';
265265
execute immediate 'alter session set nls_date_language='||gv_nls_value;
266266
execute immediate 'drop package tst_chars';
267267
end;
268-
268+
269269
procedure test_clob_to_table_multibyte is
270270
l_varchar2_byte_limit integer := 32767;
271271
l_workaround_byte_limit integer := 8191;
272272
l_singlebyte_string_max_size varchar2(32767 char) := rpad('x',l_varchar2_byte_limit,'x');
273-
l_twobyte_character char(1 char) := '';
273+
l_twobyte_character char(1 char) := '';
274274
l_clob_multibyte clob := l_twobyte_character||l_singlebyte_string_max_size; --here we have 32769(2+32767) bytes and 32768 chars
275275
l_expected ut3.ut_varchar2_list := ut3.ut_varchar2_list();
276276
l_result ut3.ut_varchar2_list;

0 commit comments

Comments
 (0)