should be it
This commit is contained in:
54
external/duckdb/test/sql/function/string/test_unicode.test
vendored
Normal file
54
external/duckdb/test/sql/function/string/test_unicode.test
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
# name: test/sql/function/string/test_unicode.test
|
||||
# description: UNICODE test
|
||||
# group: [string]
|
||||
|
||||
statement ok
|
||||
PRAGMA enable_verification
|
||||
|
||||
# test on scalars
|
||||
query IIIIII
|
||||
select UNICODE(NULL), UNICODE(''), UNICODE('$'), UNICODE('¢'), UNICODE('€'), UNICODE('𐍈')
|
||||
----
|
||||
NULL -1 36 162 8364 66376
|
||||
|
||||
# test on tables
|
||||
statement ok
|
||||
CREATE TABLE strings(a STRING, b STRING)
|
||||
|
||||
statement ok
|
||||
INSERT INTO strings VALUES ('', 'Zero'), ('$', NULL), ('¢','Two'), ('€', NULL), ('𐍈','Four')
|
||||
|
||||
query I
|
||||
select UNICODE(a) FROM strings
|
||||
----
|
||||
-1
|
||||
36
|
||||
162
|
||||
8364
|
||||
66376
|
||||
|
||||
query I
|
||||
select UNICODE(b) FROM strings
|
||||
----
|
||||
90
|
||||
NULL
|
||||
84
|
||||
NULL
|
||||
70
|
||||
|
||||
query I
|
||||
select UNICODE(a) FROM strings WHERE b IS NOT NULL
|
||||
----
|
||||
-1
|
||||
162
|
||||
66376
|
||||
|
||||
# test incorrect usage
|
||||
statement error
|
||||
select UNICODE()
|
||||
----
|
||||
|
||||
statement error
|
||||
select UNICODE(1, 2)
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user