Correct CLI migration test expectations for source8

This commit is contained in:
2026-09-24 22:07:49 -07:00
parent f232482293
commit f10490b13b
3 changed files with 43 additions and 8 deletions
+3 -3
View File
@@ -7,7 +7,7 @@ use std::{
collections::BTreeMap,
fs,
path::{Path, PathBuf},
process::{Command, Output},
process::{Command as ProcessCommand, Output},
};
#[path = "../../oa-core/src/language/analysis_source/model_oracle.rs"]
mod independent_model;
@@ -65,7 +65,7 @@ impl Fixture {
}
fn run(&self, options: &[&str]) -> Output {
let before = self.inventory();
let result = Command::new(env!("CARGO_BIN_EXE_arcadia"))
let result = ProcessCommand::new(env!("CARGO_BIN_EXE_arcadia"))
.arg("check-mixed")
.arg(self.entry())
.args(options)
@@ -473,7 +473,7 @@ fn mixed_cli_direct_disk_error_uses_existing_operation_error_envelope() {
f.put(".arcadia-save-reserved.arcadia", document(""));
let before = f.inventory();
let entry = f.0.join(".arcadia-save-reserved.arcadia");
let output = Command::new(env!("CARGO_BIN_EXE_arcadia"))
let output = ProcessCommand::new(env!("CARGO_BIN_EXE_arcadia"))
.arg("check-mixed")
.arg(&entry)
.arg("--json")
+10 -3
View File
@@ -69,6 +69,8 @@ fn complete_alarm_example_preview_then_write_and_fixed_point() {
let source = include_str!(
"../../../harness/experiments/textual-authoring-20260911/alarm-response.arcadia"
);
assert!(source.starts_with("arcadia 7;"));
let migrated_source = source.replacen("arcadia 7;", "arcadia 8;", 1);
fixture.put("project.arcadia", source);
let (code, check) = fixture.cli(&["check"]);
assert_eq!(code, 0);
@@ -76,6 +78,8 @@ fn complete_alarm_example_preview_then_write_and_fixed_point() {
let (code, preview) = fixture.cli(&["stabilize"]);
assert_eq!(code, 0);
assert_eq!(preview["identities_to_stabilize"], 40);
assert_eq!(preview["migration"]["from_schema"], 7);
assert_eq!(preview["migration"]["to_schema"], 8);
assert_eq!(preview["status"], "preview");
assert_eq!(fixture.read("project.arcadia"), source);
assert!(
@@ -94,7 +98,10 @@ fn complete_alarm_example_preview_then_write_and_fixed_point() {
for (id, _) in project.identities() {
stripped = stripped.replace(&format!(" id \"{id}\""), "");
}
assert_eq!(stripped, source, "only identity clauses may be inserted");
assert_eq!(
stripped, migrated_source,
"only identity clauses and the schema 7→8 header token may change"
);
let (code, again) = fixture.cli(&["stabilize", "--write"]);
assert_eq!(code, 0);
assert_eq!(again["changes"], serde_json::json!([]));
@@ -306,9 +313,9 @@ fn rename_shows_missing_identity_and_separate_source_migration() {
let report = candidate.report();
assert_eq!(report.identities_to_stabilize, 2);
assert_eq!(report.migration.as_ref().unwrap().from_schema, 5);
assert_eq!(report.migration.as_ref().unwrap().to_schema, 7);
assert_eq!(report.migration.as_ref().unwrap().to_schema, 8);
assert!(report.changes[0].diff.contains("-arcadia 5;"));
assert!(report.changes[0].diff.contains("+arcadia 7;"));
assert!(report.changes[0].diff.contains("+arcadia 8;"));
assert!(report.changes[0].after.contains("oa_entity crew"));
assert_eq!(fixture.read("project.arcadia"), old);
assert_eq!(candidate.write().exit_code, 0);