diff --git a/crates/fidc-core/src/engine.rs b/crates/fidc-core/src/engine.rs index 0f223cc..e00fc18 100644 --- a/crates/fidc-core/src/engine.rs +++ b/crates/fidc-core/src/engine.rs @@ -4252,6 +4252,13 @@ mod tests { } } + fn star_st_candidate(date: NaiveDate) -> CandidateEligibility { + CandidateEligibility { + is_star_st: true, + ..candidate(date) + } + } + fn one_yuan_candidate(date: NaiveDate) -> CandidateEligibility { CandidateEligibility { is_one_yuan: true, @@ -4580,6 +4587,22 @@ mod tests { assert_eq!(result.fills[0].price, 12.0); } + #[test] + fn next_bar_open_execution_risk_ignores_decision_day_star_st_state() { + let first = d(2025, 1, 2); + let second = d(2025, 1, 3); + let result = run_scheduled_next_open_with_dataset(dataset_with( + market(first, 10.0, 11.5), + market(second, 12.0, 99.0), + star_st_candidate(first), + candidate(second), + )); + + assert_eq!(result.fills.len(), 1); + assert_eq!(result.fills[0].date, second); + assert_eq!(result.fills[0].price, 12.0); + } + #[test] fn next_bar_open_execution_risk_rejects_execution_day_paused_state() { let first = d(2025, 1, 2); @@ -4622,6 +4645,20 @@ mod tests { assert_next_open_canceled_with_reason(&result, "st"); } + #[test] + fn next_bar_open_execution_risk_rejects_execution_day_star_st_state() { + let first = d(2025, 1, 2); + let second = d(2025, 1, 3); + let result = run_scheduled_next_open_with_dataset(dataset_with( + market(first, 10.0, 11.5), + market(second, 12.0, 99.0), + candidate(first), + star_st_candidate(second), + )); + + assert_next_open_canceled_with_reason(&result, "star_st"); + } + #[test] fn next_bar_open_execution_risk_rejects_execution_day_one_yuan_state() { let first = d(2025, 1, 2);