Files
kebab/crates/kebab-app/tests/skip_reason.rs
altair823 685007789a style: cargo fmt --all (round 4 ingest log feature follow-up)
Phase C4 executor 의 마지막 `fix(test): clippy + fmt fixes` commit 이
test file 부분만 fmt 적용. workspace 전체 fmt 누락 발견 → cargo fmt --all
적용. 모든 import alphabetical reorder + line wrapping 정합.

추가 untracked artifact 동시 commit:
- docs/superpowers/specs/2026-05-28-v0.20-ingest-log-spec.md (491 line, ACCEPT)
- docs/superpowers/plans/2026-05-28-v0.20-ingest-log-plan.md (616 line, ACCEPT)

workspace test: 1370 passed / 0 failed / 50 ignored, ingest_log_smoke green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-28 04:18:40 +00:00

43 lines
1.5 KiB
Rust

//! p9-fb-25 task 5: skipped per-asset items must carry a human-readable
//! reason in `warnings`, and the report's `skipped_by_extension` must
//! aggregate by lowercase extension.
mod common;
use common::TestEnv;
#[test]
fn unsupported_extension_skip_carries_warning_and_is_aggregated() {
let env = TestEnv::lexical_only();
let workspace_root = std::path::PathBuf::from(&env.config.workspace.root);
std::fs::write(workspace_root.join("legacy.docx"), b"unsupported").unwrap();
std::fs::write(workspace_root.join("Makefile"), b"unsupported").unwrap();
let report = kebab_app::ingest_with_config(env.config.clone(), env.scope(), false).unwrap();
let items = report.items.as_ref().expect("items array populated");
let docx_item = items
.iter()
.find(|i| i.doc_path.0.ends_with("legacy.docx"))
.expect("docx in items");
assert_eq!(docx_item.kind, kebab_core::IngestItemKind::Skipped);
assert_eq!(
docx_item.warnings,
vec!["unsupported media type: .docx".to_string()],
);
let makefile_item = items
.iter()
.find(|i| i.doc_path.0.ends_with("Makefile"))
.expect("Makefile in items");
assert_eq!(makefile_item.kind, kebab_core::IngestItemKind::Skipped);
assert_eq!(
makefile_item.warnings,
vec!["unsupported media type: <no-ext>".to_string()],
);
assert_eq!(report.skipped_by_extension.get("docx").copied(), Some(1));
assert_eq!(
report.skipped_by_extension.get("<no-ext>").copied(),
Some(1)
);
}