test(strategy): qualify the expected missing-market error
This commit is contained in:
@@ -21266,7 +21266,7 @@ mod tests {
|
|||||||
gap_config.stock_filter_expr = "close > 10.0".into();
|
gap_config.stock_filter_expr = "close > 10.0".into();
|
||||||
let gap_strategy = PlatformExprStrategy::new(gap_config);
|
let gap_strategy = PlatformExprStrategy::new(gap_config);
|
||||||
let indexed = gap_strategy.stock_state_with_factor_date(&gap_ctx, date, factor_date, symbol);
|
let indexed = gap_strategy.stock_state_with_factor_date(&gap_ctx, date, factor_date, symbol);
|
||||||
assert!(matches!(&indexed, Err(BacktestError::Data(crate::data::DataSetError::MissingSnapshot {
|
assert!(matches!(&indexed, Err(crate::BacktestError::Data(crate::data::DataSetError::MissingSnapshot {
|
||||||
kind: "feature_market", date: missing_date, symbol: missing_symbol,
|
kind: "feature_market", date: missing_date, symbol: missing_symbol,
|
||||||
})) if *missing_date == factor_date && missing_symbol == symbol),
|
})) if *missing_date == factor_date && missing_symbol == symbol),
|
||||||
"missing decision-date OHLCV must not become execution-date values: {indexed:?}");
|
"missing decision-date OHLCV must not become execution-date values: {indexed:?}");
|
||||||
@@ -21276,7 +21276,7 @@ mod tests {
|
|||||||
&gap_ctx, date, factor_date, missing_feature_day.symbol_id(symbol).unwrap(), symbol,
|
&gap_ctx, date, factor_date, missing_feature_day.symbol_id(symbol).unwrap(), symbol,
|
||||||
&execution_view, &feature_view,
|
&execution_view, &feature_view,
|
||||||
);
|
);
|
||||||
assert!(matches!(&viewed, Err(BacktestError::Data(crate::data::DataSetError::MissingSnapshot {
|
assert!(matches!(&viewed, Err(crate::BacktestError::Data(crate::data::DataSetError::MissingSnapshot {
|
||||||
kind: "feature_market", date: missing_date, ..
|
kind: "feature_market", date: missing_date, ..
|
||||||
})) if *missing_date == factor_date), "daily views must preserve the same missing-date boundary: {viewed:?}");
|
})) if *missing_date == factor_date), "daily views must preserve the same missing-date boundary: {viewed:?}");
|
||||||
assert!(gap_strategy.stock_state_cache.borrow().is_empty());
|
assert!(gap_strategy.stock_state_cache.borrow().is_empty());
|
||||||
|
|||||||
Reference in New Issue
Block a user