test: red executable-spec for #264 cut 2 — aura data list enumerates symbols

aura data list must print the archive's symbols sorted, one per line,
exit 0 — the discovery step before aura data coverage. Hostless RED over
the synthetic SYMA+SYMB archive; fails on the absent 'list' subcommand
(clap exit 2), not on scaffolding.

refs #264
This commit is contained in:
2026-07-13 21:52:32 +02:00
parent 529a8af0d6
commit a7d465d2b5
+33
View File
@@ -5904,3 +5904,36 @@ fn data_coverage_reports_month_span_and_interior_gap_range() {
"first (2024-01) and last (2024-06) present month reported: {stdout}" "first (2024-01) and last (2024-06) present month reported: {stdout}"
); );
} }
/// Property (#264, list cut 2): `aura data list` enumerates the symbols the
/// archive contains, one per line, sorted — the discovery step a campaign
/// author (or an agent operating through the CLI alone, the deployment
/// posture) needs before `aura data coverage <symbol>`, since without it the
/// inventory is obtainable only by listing the archive directory outside
/// aura. The archive root resolves through the same project path as `coverage`
/// (`Env::data_path` — a project-local `[paths] data` override when set). Over
/// a hermetic synthetic archive holding two symbols (`SYMA` 2024-01..08 and
/// `SYMB` 2024-03..06), the verb exits 0 and prints EXACTLY the two symbol
/// names in ascending order, one per line — `SYMA` before `SYMB`, nothing
/// else.
#[test]
fn data_list_enumerates_archive_symbols_one_per_line_sorted() {
let (cwd, _g) = fresh_project_with_data();
let out = std::process::Command::new(env!("CARGO_BIN_EXE_aura"))
.args(["data", "list"])
.current_dir(&cwd)
.output()
.expect("spawn aura data list");
assert_eq!(
out.status.code(),
Some(0),
"exit: {:?}, stderr: {}",
out.status,
String::from_utf8_lossy(&out.stderr)
);
let stdout = String::from_utf8(out.stdout).expect("utf-8 stdout");
// The whole contract: the two archive symbols, sorted, one per line, and
// nothing else — this is the inventory a campaign author reads before
// scoping an instrument matrix.
assert_eq!(stdout, "SYMA\nSYMB\n", "sorted symbol enumeration: {stdout:?}");
}