use super::*;
fn off_args() -> ServeSpecCostArgs {
ServeSpecCostArgs {
spec_cost_model: SpecCostModel::Off,
spec_cost_table: None,
spec_cost_calibration: None,
spec_cost_recipe: None,
spec_cost_slack: None,
}
}
#[test]
fn off_is_none_without_reading_anything() {
assert!(
resolve(&off_args(), None, 100_000, "bf16")
.unwrap()
.is_none()
);
}
#[test]
fn measured_without_a_drafter_is_refused() {
let args = ServeSpecCostArgs {
spec_cost_model: SpecCostModel::Measured,
spec_cost_table: Some("/nonexistent/table.toml".into()),
spec_cost_calibration: Some("/nonexistent/cal.toml".into()),
spec_cost_recipe: Some("x/x".into()),
spec_cost_slack: Some(0.0),
};
assert!(resolve(&args, None, 100_000, "bf16").is_err());
}