v0.2.14-pre.003
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// file: crates/ksp-program-api/tests/dependency_boundary.rs
|
||||
// version: 1
|
||||
// version: 2
|
||||
|
||||
//! Dependency and declarative-surface canaries for the Program API scaffold.
|
||||
//! Dependency and declarative-surface canaries for the Program API foundation.
|
||||
|
||||
#[test]
|
||||
fn pre_002_manifest_has_exact_core_and_interface_runtime_dependencies() {
|
||||
@@ -46,23 +46,27 @@ fn pre_002_manifest_has_exact_core_and_interface_runtime_dependencies() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_002_crate_root_is_facade_only_without_decoder_runtime_surface() {
|
||||
fn pre_003_crate_root_adds_only_recognition_and_decode_outcome() {
|
||||
let crate_root = include_str!("../src/lib.rs");
|
||||
for required in ["Error", "ErrorCode", "ErrorContext", "Pubkey", "Result", "ProgramAccountMeta", "ProgramInstruction"] {
|
||||
for required in [
|
||||
"ProgramInstructionDecodeOutcome",
|
||||
"ProgramInstructionRecognition",
|
||||
"Error",
|
||||
"ErrorCode",
|
||||
"ErrorContext",
|
||||
"Pubkey",
|
||||
"Result",
|
||||
"ProgramAccountMeta",
|
||||
"ProgramInstruction",
|
||||
] {
|
||||
assert!(crate_root.contains(required), "required Program API facade export missing: {required}");
|
||||
}
|
||||
for forbidden in [
|
||||
"pub mod ",
|
||||
"ProgramInstructionRecognition",
|
||||
"ProgramInstructionDecodeOutcome",
|
||||
"ProgramInstructionDecoder",
|
||||
"ProgramExecutionPreparer",
|
||||
"TRACING_TARGET",
|
||||
"ksp_logging_lib",
|
||||
"serde",
|
||||
"Any",
|
||||
] {
|
||||
assert!(!crate_root.contains(forbidden), "forbidden pre.002 Program API surface detected: {forbidden}");
|
||||
for forbidden in ["pub mod ", "ProgramInstructionDecoder", "ProgramExecutionPreparer", "TRACING_TARGET", "ksp_logging_lib", "serde", "Any"] {
|
||||
assert!(!crate_root.contains(forbidden), "forbidden pre.003 Program API surface detected: {forbidden}");
|
||||
}
|
||||
let outcome_source = include_str!("../src/program_instruction_decode.rs");
|
||||
for forbidden in ["Ignored", "Failed", "serde", "Any"] {
|
||||
assert!(!outcome_source.contains(forbidden), "forbidden recognition/outcome concept detected: {forbidden}");
|
||||
}
|
||||
assert!(!std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("src/constants.rs").exists());
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user