v0.3.9-pre.002-fix.002
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-api/src/snapshot.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
/// Monotone sequence attached to one latest-value Worker snapshot stream.
|
||||
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
@@ -37,6 +37,11 @@ impl crate::WorkerSnapshotSequence {
|
||||
pub const fn is_after(&self, observed: Self) -> bool {
|
||||
return self.0 > observed.0;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
const fn exhausted_for_test() -> Self {
|
||||
return Self(u64::MAX);
|
||||
}
|
||||
}
|
||||
|
||||
/// Fixed common latest-value snapshot exposed by every Worker implementation.
|
||||
@@ -130,7 +135,7 @@ pub trait WorkerSnapshotSource: std::marker::Send + std::marker::Sync {
|
||||
|
||||
#[cfg(test)]
|
||||
fn exhausted_snapshot_sequence() -> crate::WorkerSnapshotSequence {
|
||||
return crate::WorkerSnapshotSequence(u64::MAX);
|
||||
return crate::WorkerSnapshotSequence::exhausted_for_test();
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-worker-api/tests/dependency_boundary.rs
|
||||
// version: 2
|
||||
// version: 3
|
||||
|
||||
//! Dependency and runtime-neutrality canaries for the Worker API foundation.
|
||||
|
||||
@@ -82,12 +82,7 @@ fn pre_002_fix_001_shared_visible_items_use_crate_root_facade_inside_owner_modul
|
||||
] {
|
||||
assert!(lifecycle.contains(expected), "missing crate-root Worker lifecycle impl target: {expected}");
|
||||
}
|
||||
for expected in [
|
||||
"impl crate::WorkerSnapshotSequence {",
|
||||
"impl crate::WorkerSnapshot {",
|
||||
"impl std::fmt::Debug for crate::WorkerSnapshot {",
|
||||
"return crate::WorkerSnapshotSequence(u64::MAX);",
|
||||
] {
|
||||
for expected in ["impl crate::WorkerSnapshotSequence {", "impl crate::WorkerSnapshot {", "impl std::fmt::Debug for crate::WorkerSnapshot {"] {
|
||||
assert!(snapshot.contains(expected), "missing crate-root Worker snapshot reference: {expected}");
|
||||
}
|
||||
for expected in [
|
||||
@@ -100,6 +95,16 @@ fn pre_002_fix_001_shared_visible_items_use_crate_root_facade_inside_owner_modul
|
||||
return;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pre_002_fix_002_private_tuple_constructor_stays_inside_owner_impl() {
|
||||
let snapshot = include_str!("../src/snapshot.rs");
|
||||
assert!(snapshot.contains("const fn exhausted_for_test() -> Self {"));
|
||||
assert!(snapshot.contains("return Self(u64::MAX);"));
|
||||
assert!(snapshot.contains("return crate::WorkerSnapshotSequence::exhausted_for_test();"));
|
||||
assert!(!snapshot.contains("return crate::WorkerSnapshotSequence(u64::MAX);"));
|
||||
return;
|
||||
}
|
||||
|
||||
fn manifest_dependency_names(section: &str) -> std::vec::Vec<&str> {
|
||||
let mut names = std::vec::Vec::new();
|
||||
for line in section.lines() {
|
||||
|
||||
Reference in New Issue
Block a user