Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codex-rs/core/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1629,4 +1629,4 @@
},
"title": "ConfigToml",
"type": "object"
}
}
14 changes: 14 additions & 0 deletions codex-rs/core/src/config/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ pub fn write_config_schema(out_path: &Path) -> anyhow::Result<()> {
mod tests {
use super::canonicalize;
use super::config_schema_json;
use super::write_config_schema;

use pretty_assertions::assert_eq;
use similar::TextDiff;
use tempfile::TempDir;

#[test]
fn config_schema_matches_fixture() {
Expand Down Expand Up @@ -128,5 +131,16 @@ mod tests {
Run `just write-config-schema` to overwrite with your changes.\n\n{diff}"
);
}

// Make sure the version in the repo matches exactly: https://github.com/openai/codex/pull/10977.
let tmp = TempDir::new().expect("create temp dir");
let tmp_path = tmp.path().join("config.schema.json");
write_config_schema(&tmp_path).expect("write config schema to temp path");
let tmp_contents =
std::fs::read_to_string(&tmp_path).expect("read back config schema from temp path");
assert_eq!(
fixture, tmp_contents,
"fixture should match exactly with generated schema"
);
}
}
Loading