Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgerrets committed Feb 28, 2024
1 parent 73a228a commit f38ebf8
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/sql/function/string/test_format.test
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,24 @@ statement error
SELECT format('{:d}', 'hello')
----

# unsigned
query T
SELECT format('{}', 255::UTINYINT)
----
255

query T
SELECT format('{}', 65535::USMALLINT)
----
65535

query T
SELECT format('{}', 4294967295::UINTEGER)
----
4294967295

query T
SELECT format('{}', 18446744073709551615::UBIGINT)
----
18446744073709551615

38 changes: 38 additions & 0 deletions test/sql/function/string/test_format_hugeint.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# name: test/sql/function/string/test_format_hugeint.test
# description: Test format on (u)hugeints
# group: [string]

statement ok
PRAGMA enable_verification

query I
select format('{}', '100000000000000000000000000000'::HUGEINT)
----
100000000000000000000000000000

query I
select format('{}', '100000000000000000000000000000'::UHUGEINT)
----
100000000000000000000000000000

# limits
query I
select format('{}', '170141183460469231731687303715884105727'::HUGEINT)
----
170141183460469231731687303715884105727

query I
select format('{}', '340282366920938463463374607431768211455'::UHUGEINT)
----
340282366920938463463374607431768211455

# thousand seperator
query I
select format('{:,}', '100000000000000000000000000000'::HUGEINT)
----
100,000,000,000,000,000,000,000,000,000

query I
select format('{:,}', '100000000000000000000000000000'::UHUGEINT)
----
100,000,000,000,000,000,000,000,000,000

0 comments on commit f38ebf8

Please sign in to comment.