33 lines
1.3 KiB
Rust
33 lines
1.3 KiB
Rust
// file: crates/ksp-store-api/tests/public_api.rs
|
|
// version: 1
|
|
|
|
//! Integration canaries for the public `ksp-store-api` scaffold.
|
|
|
|
fn consume_result(value: ksp_store_api::Result<ksp_store_api::Pubkey>) -> ksp_store_api::Result<ksp_store_api::Pubkey> {
|
|
return value;
|
|
}
|
|
|
|
#[test]
|
|
fn public_pre_002_core_facade_is_available_from_crate_root() {
|
|
let pubkey = ksp_store_api::Pubkey::new_from_array([0x31_u8; 32]);
|
|
let forwarded = consume_result(std::result::Result::Ok(pubkey));
|
|
assert!(forwarded.is_ok());
|
|
let error_code_type: std::option::Option<ksp_store_api::ErrorCode> = std::option::Option::None;
|
|
let error_context_type: std::option::Option<ksp_store_api::ErrorContext> = std::option::Option::None;
|
|
let error_type: std::option::Option<ksp_store_api::Error> = std::option::Option::None;
|
|
assert!(error_code_type.is_none());
|
|
assert!(error_context_type.is_none());
|
|
assert!(error_type.is_none());
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn public_pre_002_scaffold_exposes_no_private_module_paths_or_backend_types() {
|
|
let source = include_str!("../src/lib.rs");
|
|
assert!(!source.contains("pub mod "));
|
|
for forbidden in ["Postgres", "Sql", "Migration", "ProgramInstruction", "RawTransaction"] {
|
|
assert!(!source.contains(forbidden), "forbidden pre.002 Store API public concept detected: {forbidden}");
|
|
}
|
|
return;
|
|
}
|