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

Function test_privilege_functions_error_handling

src/functions/system_functions.rs:664–683  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

662
663 #[test]
664 fn test_privilege_functions_error_handling() {
665 let conn = Connection::open_in_memory().unwrap();
666 register_system_functions(&conn).unwrap();
667
668 // Test pg_has_role with invalid privilege
669 let result = conn.query_row(
670 "SELECT pg_has_role('pg_read_all_data', 'INVALID')",
671 [],
672 |row| row.get::<_, i32>(0)
673 );
674 assert!(result.is_err()); // Should fail with invalid privilege
675
676 // Test has_table_privilege with invalid privilege
677 let result = conn.query_row(
678 "SELECT has_table_privilege('test_table', 'INVALID')",
679 [],
680 |row| row.get::<_, i32>(0)
681 );
682 assert!(result.is_err()); // Should fail with invalid privilege
683 }
684
685 #[test]
686 fn test_obj_description() {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected