mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-18 09:04:19 +01:00
printf: this commit adds support for https://github.com/tursodatabase/limbo/issues/885 tracking printf functionality
this commit introduces basic support for printf functionality and doesn't include advanced modifiers like width etc.
This commit is contained in:
22
testing/scalar-functions-printf.test
Normal file
22
testing/scalar-functions-printf.test
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env tclsh
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
# Basic string formatting
|
||||
do_execsql_test printf-basic-string {
|
||||
SELECT printf('Hello World!');
|
||||
} {{Hello World!}}
|
||||
|
||||
do_execsql_test printf-string-replacement {
|
||||
SELECT printf('Hello, %s', 'Alice');
|
||||
} {{Hello, Alice}}
|
||||
|
||||
do_execsql_test printf-numeric-replacement {
|
||||
SELECT printf('My number is: %d', 42);
|
||||
} {{My number is: 42}}
|
||||
|
||||
# Multiple consecutive format specifiers
|
||||
do_execsql_test printf-consecutive-formats {
|
||||
SELECT printf('%d%s%f', 1, 'test', 2.5);
|
||||
} {{1test2.500000}}
|
||||
Reference in New Issue
Block a user