#!/usr/bin/env bash set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" TMP="$(mktemp -d "${TMPDIR:-/tmp}/docfill-smoke.XXXXXX")" cleanup() { rm -rf "$TMP" } trap cleanup EXIT cd "$ROOT" go test -count=1 ./... go build -o "$TMP/docfill" ./cmd/docfill cp -R examples "$TMP/examples" go run ./scripts/smoke-fixtures --base "$TMP/examples" "$TMP/docfill" run -c "$TMP/examples/excel-to-word/task.json" --var date=2026-06-18 "$TMP/docfill" run -c "$TMP/examples/excel-filter-to-word/task.json" --var date=2026-06-18 --var ticket_no=GD-002 "$TMP/docfill" run -c "$TMP/examples/sqlite-to-excel/task.json" --var date=2026-06-18 test -f "$TMP/examples/excel-to-word/out/daily_2026-06-18_张三_1.docx" test -f "$TMP/examples/excel-to-word/out/daily_2026-06-18_李四_2.docx" test -f "$TMP/examples/excel-filter-to-word/out/ticket_2026-06-18_GD-002.docx" test ! -f "$TMP/examples/excel-filter-to-word/out/ticket_2026-06-18_GD-001.docx" xlsx_count="$(find "$TMP/examples/sqlite-to-excel/out" -type f -name '*.xlsx' | wc -l | tr -d ' ')" if [[ "$xlsx_count" != "2" ]]; then echo "expected 2 sqlite-to-excel outputs, got $xlsx_count" >&2 exit 1 fi echo "smoke ok"