fuzz-parser-exposure: doc-hidden re-exports of the @every parsers + skip_forward (three engines); visibility-only — sqlite substrate facade mod.rs line + PROVENANCE D-37; compile-level reachability pins per engine
This commit is contained in:
1 parent
860c5d6129
commit
21ab6fe564
12 files changed
+143
-22
No files matched your search
@@ -0,0 +1,5 @@
|
||||
#[test]
|
||||
fn doc_hidden_reexports_reach_the_crate_root() {
|
||||
assert_eq!(crate::parse_every_interval("@every 5s").unwrap(), 5);
|
||||
assert_eq!(crate::skip_forward(0, 20, 5), 25);
|
||||
}
|
||||
@@ -51,4 +51,18 @@ mod tx;
|
||||
mod validation;
|
||||
mod wakes;
|
||||
|
||||
#[cfg(test)]
|
||||
mod fuzz_surface_tests;
|
||||
|
||||
pub use store::MemStore;
|
||||
|
||||
/// Fuzz/test-only surface: the mem engine's `@every` parser — not
|
||||
/// contract surface, not consumer API, no stability guarantee.
|
||||
#[doc(hidden)]
|
||||
pub use scheduler::parse_every_interval;
|
||||
|
||||
/// Fuzz/test-only surface: the mem engine's schedule skip-forward
|
||||
/// arithmetic — not contract surface, not consumer API, no stability
|
||||
/// guarantee.
|
||||
#[doc(hidden)]
|
||||
pub use scheduler::skip_forward;
|
||||
@@ -87,7 +87,7 @@ fn leader_owner() -> String {
|
||||
/// parser (third owner per ADR-012 §2; the grammar is small and
|
||||
/// pinned). Everything else — 5-field cron, seconds-field cron —
|
||||
/// rejects as `InvalidSpec`.
|
||||
pub(crate) fn parse_every_interval(spec: &str) -> Result<i64> {
|
||||
pub fn parse_every_interval(spec: &str) -> Result<i64> {
|
||||
let Some(body) = spec.strip_prefix("@every ") else {
|
||||
return Err(invalid_spec(spec));
|
||||
};
|
||||
@@ -251,7 +251,7 @@ fn fire_due(sched: &mut ScheduleState, queues: &mut QueueState, state: &State, n
|
||||
/// The bounded catch-up's skip-forward: land the next boundary strictly
|
||||
/// in the future, grid-aligned (the schedule row's advance makes the
|
||||
/// gap inspectable).
|
||||
fn skip_forward(next_fire_at: i64, now: i64, interval: i64) -> i64 {
|
||||
pub fn skip_forward(next_fire_at: i64, now: i64, interval: i64) -> i64 {
|
||||
let gap = (now - next_fire_at) as i128;
|
||||
let interval = interval as i128;
|
||||
let next = (next_fire_at as i128) + (gap / interval + 1) * interval;
|
||||
|
||||
Reference in new issue
Block a user