v0.3.3-pre.008
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-store-lib/unit_tests/store.rs
|
||||
// version: 4
|
||||
// version: 5
|
||||
|
||||
fn poll_ready<T>(future: impl std::future::Future<Output = T>) -> T {
|
||||
let mut future = std::boxed::Box::pin(future);
|
||||
@@ -55,3 +55,20 @@ fn known_postgres_without_feature_is_rejected_before_io() {
|
||||
assert_eq!(error.map(|value| return value.code()), std::option::Option::Some(crate::ERROR_CODE_BACKEND_NOT_COMPILED));
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_008_operation_network_guard_rejects_mismatch_without_echoing_requested_network() {
|
||||
let store_network = valid_network();
|
||||
let hostile = match crate::RawNetworkId::new("other-network") {
|
||||
std::result::Result::Ok(value) => value,
|
||||
std::result::Result::Err(error) => panic!("valid alternate network rejected: {error:?}"),
|
||||
};
|
||||
let result = super::validate_operation_network(&store_network, &hostile, crate::StoreBackendKind::Postgres);
|
||||
let error = match result {
|
||||
std::result::Result::Err(value) => value,
|
||||
std::result::Result::Ok(()) => panic!("wrong operation network unexpectedly accepted"),
|
||||
};
|
||||
assert_eq!(error.code(), crate::ERROR_CODE_WRONG_NETWORK);
|
||||
assert!(!std::format!("{error:?}").contains("other-network"));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user