diff --git a/crates/aura-cli/tests/cli_run.rs b/crates/aura-cli/tests/cli_run.rs index c139755..7698107 100644 --- a/crates/aura-cli/tests/cli_run.rs +++ b/crates/aura-cli/tests/cli_run.rs @@ -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}" ); } + +/// 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 `, 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:?}"); +}