limbo/testing/scalar-functions-printf.test
Zaid Humayun 4cb6f8cc6a fixing: failing test was expecting 2.50000
this test is behaving differently in different environments
2025-02-04 20:53:10 +05:30

22 lines
No EOL
557 B
Tcl

#!/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.5}}