MCPcopy Create free account
hub / github.com/erans/pgsqlite / test_translate

Function test_translate

src/functions/string_functions.rs:303–321  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 2

getMethod · 0.45

Tested by

no test coverage detected