-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.rs
More file actions
49 lines (43 loc) · 1.87 KB
/
Copy pathlib.rs
File metadata and controls
49 lines (43 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! EQL test framework infrastructure
//!
//! Provides assertion builders and test helpers for EQL functionality tests.
use sqlx::PgPool;
pub mod assertions;
pub mod fixtures;
pub mod helpers;
pub mod matrix;
pub mod scalar_domains;
#[macro_use]
pub mod scalar_types;
pub mod selectors;
// Re-export `paste` under a stable path so the `scalar_domain_matrix!` macro
// can refer to `$crate::paste::paste!` without requiring callers to depend on
// the `paste` crate directly.
#[doc(hidden)]
pub use paste;
// Re-export the harness proc-macro crate under a stable path so the
// `scalar_types!` macro can refer to `$crate::eql_tests_macros::<emitter>!`
// without each call site depending on the proc-macro crate directly.
#[doc(hidden)]
pub use eql_tests_macros;
pub use assertions::{assert_db_error, QueryAssertion};
pub use helpers::{
analyze_table, assert_no_seq_scan, assert_sequential_ids, assert_uses_index,
assert_uses_seq_scan, create_jsonb_gin_index, ensure_pg_stat_statements, explain_analyze_avg,
explain_json, explain_query, get_bench_encrypted_int, get_bench_encrypted_text,
get_encrypted_term, get_ore_encrypted, get_ore_encrypted_as_jsonb, get_ore_text_encrypted,
get_ore_text_encrypted_as_jsonb, get_ste_vec_encrypted, get_ste_vec_encrypted_pair,
get_ste_vec_selector_term, get_ste_vec_sv_element, get_ste_vec_term_by_id,
read_pg_stat_statements, reset_pg_stat_statements, ExplainStats, PgStatEntry,
PLACEHOLDER_PAYLOAD,
};
pub use scalar_domains::{
assert_null, assert_raises, assert_scalar_plaintexts, blocker_msg, commute_op,
fetch_fixture_payload, sql_string_literal, ScalarDomainSpec, ScalarType, Variant,
};
pub use selectors::Selectors;
/// Reset pg_stat_user_functions tracking before tests
pub async fn reset_function_stats(pool: &PgPool) -> anyhow::Result<()> {
sqlx::query("SELECT pg_stat_reset()").execute(pool).await?;
Ok(())
}