Compare commits

...

2 Commits

Author SHA1 Message Date
Owen Lin
6d42f1d6a9 unit tests 2026-01-13 16:32:26 -08:00
Owen Lin
67dcf3952d fix(core): update models.json model priorities 2026-01-13 16:20:03 -08:00
2 changed files with 47 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@@ -705,4 +705,47 @@ mod tests {
"bundled models.json should contain at least one model"
);
}
#[test]
fn bundled_models_json_priorities_are_unique() {
let file_contents = include_str!("../../models.json");
let response: ModelsResponse =
serde_json::from_str(file_contents).expect("bundled models.json should deserialize");
let mut seen = HashSet::new();
for model in &response.models {
assert!(
seen.insert(model.priority),
"duplicate priority {}",
model.priority
);
}
}
#[test]
fn bundled_models_json_slugs_match_priority_order() {
let file_contents = include_str!("../../models.json");
let response: ModelsResponse =
serde_json::from_str(file_contents).expect("bundled models.json should deserialize");
let mut models = response.models;
models.sort_by(|a, b| a.priority.cmp(&b.priority));
let slugs: Vec<String> = models.into_iter().map(|model| model.slug).collect();
let expected = vec![
"gpt-5.2",
"gpt-5.1-codex-max",
"gpt-5.1-codex",
"gpt-5.1-codex-mini",
"gpt-5.1",
"gpt-5-codex",
"gpt-5",
"gpt-5-codex-mini",
]
.into_iter()
.map(str::to_string)
.collect::<Vec<String>>();
assert_eq!(slugs, expected);
}
}