modernc.org/cc@v1.0.1/v2/testdata/_sqlite/test/pragma5.test (about) 1 # 2017 August 25 2 # 3 # The author disclaims copyright to this source code. In place of 4 # a legal notice, here is a blessing: 5 # 6 # May you do good and not evil. 7 # May you find forgiveness for yourself and forgive others. 8 # May you share freely, never taking more than you give. 9 # 10 #*********************************************************************** 11 # This file implements regression tests for SQLite library. 12 # 13 # This file implements tests for the PRAGMA command. Specifically, 14 # those pragmas enabled at build time by setting: 15 # 16 # -DSQLITE_INTROSPECTION_PRAGMAS 17 # 18 19 set testdir [file dirname $argv0] 20 source $testdir/tester.tcl 21 set testprefix pragma5 22 23 if { [catch {db one "SELECT count(*) FROM pragma_function_list"}] } { 24 finish_test 25 return 26 } 27 28 db function external external 29 30 do_execsql_test 1.0 { 31 PRAGMA table_info(pragma_function_list) 32 } { 33 0 name {} 0 {} 0 34 1 builtin {} 0 {} 0 35 } 36 do_execsql_test 1.1 { 37 SELECT * FROM pragma_function_list WHERE name='upper' 38 } {upper 1} 39 do_execsql_test 1.2 { 40 SELECT * FROM pragma_function_list WHERE name LIKE 'exter%'; 41 } {external 0} 42 43 ifcapable fts5 { 44 do_execsql_test 2.0 { 45 PRAGMA table_info(pragma_module_list) 46 } { 47 0 name {} 0 {} 0 48 } 49 do_execsql_test 2.1 { 50 SELECT * FROM pragma_module_list WHERE name='fts5' 51 } {fts5} 52 } 53 54 do_execsql_test 3.0 { 55 PRAGMA table_info(pragma_pragma_list) 56 } { 57 0 name {} 0 {} 0 58 } 59 do_execsql_test 3.1 { 60 SELECT * FROM pragma_pragma_list WHERE name='pragma_list' 61 } {pragma_list} 62 63 64 finish_test