()
| 532 | |
| 533 | #[test] |
| 534 | fn test_trigonometric() { |
| 535 | let conn = Connection::open_in_memory().unwrap(); |
| 536 | register_math_functions(&conn).unwrap(); |
| 537 | |
| 538 | // Test sin(pi/2) = 1 |
| 539 | let result: f64 = conn.query_row( |
| 540 | "SELECT sin(pi() / 2)", |
| 541 | [], |
| 542 | |row| row.get(0) |
| 543 | ).unwrap(); |
| 544 | assert!((result - 1.0).abs() < 1e-10); |
| 545 | |
| 546 | // Test cos(0) = 1 |
| 547 | let result: f64 = conn.query_row( |
| 548 | "SELECT cos(0)", |
| 549 | [], |
| 550 | |row| row.get(0) |
| 551 | ).unwrap(); |
| 552 | assert_eq!(result, 1.0); |
| 553 | } |
| 554 | |
| 555 | #[test] |
| 556 | fn test_logarithms() { |
nothing calls this directly
no test coverage detected