()
| 301 | |
| 302 | #[test] |
| 303 | fn test_translate() { |
| 304 | let conn = Connection::open_in_memory().unwrap(); |
| 305 | register_string_functions(&conn).unwrap(); |
| 306 | |
| 307 | let result: String = conn.query_row( |
| 308 | "SELECT translate('hello', 'elo', 'xyz')", |
| 309 | [], |
| 310 | |row| row.get(0) |
| 311 | ).unwrap(); |
| 312 | assert_eq!(result, "hxyyz"); |
| 313 | |
| 314 | // Test character removal (to_chars shorter than from_chars) |
| 315 | let result: String = conn.query_row( |
| 316 | "SELECT translate('hello', 'elo', 'x')", |
| 317 | [], |
| 318 | |row| row.get(0) |
| 319 | ).unwrap(); |
| 320 | assert_eq!(result, "hx"); |
| 321 | } |
| 322 | |
| 323 | #[test] |
| 324 | fn test_ascii_chr() { |
nothing calls this directly
no test coverage detected