v0.3.8-pre.005

This commit is contained in:
2026-09-03 13:09:25 +02:00
parent 3bb73e81e4
commit bf73481180
17 changed files with 891 additions and 43 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-store-lib/tests/hardening_completeness.rs
// version: 8
// version: 9
#![warn(missing_docs)]
#![deny(unreachable_pub)]
@@ -292,11 +292,12 @@ fn pre_009_facade_production_sources_keep_config_env_physical_sql_and_backend_ha
}
#[test]
fn v0_3_8_pre_004_facade_raw_capability_inventory_is_exactly_eleven() {
fn v0_3_8_pre_005_facade_raw_capability_inventory_is_exactly_twelve() {
let store = include_str!("../src/store.rs");
let capability_impls = [
"impl ksp_store_api::RawAccountObservationRead for Store",
"impl ksp_store_api::RawAccountObservationWrite for Store",
"impl ksp_store_api::RawAccountStateInspectionRead for Store",
"impl ksp_store_api::RawAccountStateRead for Store",
"impl ksp_store_api::RawAccountStateWrite for Store",
"impl ksp_store_api::RawTransactionInspectionRead for Store",
@@ -310,22 +311,22 @@ fn v0_3_8_pre_004_facade_raw_capability_inventory_is_exactly_eleven() {
for implementation in capability_impls {
assert_eq!(store.matches(implementation).count(), 1, "unexpected Store capability implementation inventory: {implementation}");
}
assert_eq!(store.matches("impl ksp_store_api::Raw").count(), 11);
assert_eq!(store.matches("validate_operation_network(").count(), 15);
assert_eq!(store.matches("impl ksp_store_api::Raw").count(), 12);
assert_eq!(store.matches("validate_operation_network(").count(), 16);
return;
}
#[test]
fn v0_3_8_pre_004_facade_and_backend_capability_sets_match_with_transaction_inspection_only() {
fn v0_3_8_pre_005_facade_and_backend_capability_sets_match_with_both_inspection_capabilities() {
let store = include_str!("../src/store.rs");
let backend = include_str!("../../ksp-store-postgres-lib/src/runtime.rs");
let store_traits = raw_capability_trait_names(store, " for Store");
let backend_traits = raw_capability_trait_names(backend, " for PostgresBackend");
assert_eq!(store_traits.len(), 11);
assert_eq!(backend_traits.len(), 11);
assert_eq!(store_traits.len(), 12);
assert_eq!(backend_traits.len(), 12);
assert_eq!(store_traits, backend_traits);
assert!(store_traits.contains(&"RawTransactionInspectionRead"));
assert!(!store_traits.contains(&"RawAccountStateInspectionRead"));
assert!(store_traits.contains(&"RawAccountStateInspectionRead"));
for forbidden in ["RawAccountRetentionRead", "RawAccountRetentionWrite", "RawAccountDelete", "RawAccountCompaction"] {
assert!(!store_traits.contains(&forbidden), "unexpected account capability added to Store: {forbidden}");
assert!(!backend_traits.contains(&forbidden), "unexpected account capability added to PostgreSQL backend: {forbidden}");