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

Function test_round_with_precision

src/functions/math_functions.rs:447–464  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

445
446 #[test]
447 fn test_round_with_precision() {
448 let conn = Connection::open_in_memory().unwrap();
449 register_math_functions(&conn).unwrap();
450
451 let result: f64 = conn.query_row(
452 "SELECT round(3.789, 2)",
453 [],
454 |row| row.get(0)
455 ).unwrap();
456 assert_eq!(result, 3.79);
457
458 let result: f64 = conn.query_row(
459 "SELECT round(3.784, 2)",
460 [],
461 |row| row.get(0)
462 ).unwrap();
463 assert_eq!(result, 3.78);
464 }
465
466 #[test]
467 fn test_ceil_floor() {

Callers

nothing calls this directly

Calls 2

register_math_functionsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected