diff options
Diffstat (limited to 'dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.16/sqlite3_opt_math_functions_test.go')
-rw-r--r-- | dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.16/sqlite3_opt_math_functions_test.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.16/sqlite3_opt_math_functions_test.go b/dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.16/sqlite3_opt_math_functions_test.go new file mode 100644 index 0000000..6ff076b --- /dev/null +++ b/dependencies/pkg/mod/github.com/mattn/go-sqlite3@v1.14.16/sqlite3_opt_math_functions_test.go @@ -0,0 +1,29 @@ +// +build sqlite_math_functions + +package sqlite3 + +import ( + "database/sql" + "testing" +) + +func TestMathFunctions(t *testing.T) { + db, err := sql.Open("sqlite3", ":memory:") + if err != nil { + t.Fatal("Failed to open database:", err) + } + defer db.Close() + + queries := []string{ + `SELECT acos(1)`, + `SELECT log(10, 100)`, + `SELECT power(2, 2)`, + } + + for _, query := range queries { + var result float64 + if err := db.QueryRow(query).Scan(&result); err != nil { + t.Errorf("invoking math function query %q: %v", query, err) + } + } +} |