better domain isolation
Generate check / check-changes (pull_request) Successful in 2s
Generate check / verify-generate (pull_request) Skipped
Quality / check-changes (pull_request) Successful in 2s
Quality / static-checks (pull_request) Failing after 13s
Quality / run-tests (pull_request) Failing after 54s

This commit is contained in:
natercio committed 2026-10-05 15:08:26 +01:00
1 parent e167627ac3
commit 5c146ad60f
10 files changed
+342 -242

No files matched your search

+1 -4
View File
@@ -115,10 +115,7 @@ func runWithIO(ctx context.Context, stdin io.Reader, stdout io.Writer) error {
if err != nil {
return fmt.Errorf("create localizer: %w", err)
}
// RenderHTML never writes to the printer's output writer, so
// io.Discard is safe here.
printer := table.NewPrinter(io.Discard, loc)
return htmlwriter.NewWriter(stdout, printer, loc, *lang).Render(writer)
return htmlwriter.NewWriter(stdout, loc, *lang).Render(writer)
default:
return fmt.Errorf("unsupported format %q: must be table, csv or html", *format)
}
+3
View File
@@ -159,6 +159,9 @@ func TestRunWithIO_HTMLFormat(t *testing.T) {
t.Errorf("expected HTML output to start with <!DOCTYPE html>; got prefix: %q",
got[:min(len(got), 64)])
}
if !strings.Contains(got, "<h1>Tax report</h1>") {
t.Errorf("expected output to contain the translated report title")
}
if !strings.Contains(got, "table-responsive") {
t.Errorf("expected output to contain Bootstrap table-responsive wrapper")
}