Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test if math functions are compiled in
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// +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 { | ||
if _, err := db.Exec(query); err != nil { | ||
t.Fatal("Failed to call math function:", err) | ||
} | ||
} | ||
} |