From 020fb2db77a224458fedd8aa28dc5bb085a5a5c3 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Sun, 28 Jun 2026 08:09:18 -0700 Subject: [PATCH] suppress output on tests --- src/analytics/analysis.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/analytics/analysis.zig b/src/analytics/analysis.zig index 04a7bc1..2d5a522 100644 --- a/src/analytics/analysis.zig +++ b/src/analytics/analysis.zig @@ -3,6 +3,7 @@ /// Takes portfolio allocations (with market values) and classification metadata, /// produces breakdowns by asset class, sector, geographic region, account, and tax type. const std = @import("std"); +const builtin = @import("builtin"); const srf = @import("srf"); const Allocation = @import("valuation.zig").Allocation; const ClassificationMap = @import("../models/classification.zig").ClassificationMap; @@ -257,7 +258,11 @@ pub fn parseAccountsFile(allocator: std.mem.Allocator, data: []const u8) !Accoun // treat the account as unset so the audit uses its default. const lot_threshold: ?f64 = if (entry.audit_large_lot_threshold) |t| blk: { if (t > 0) break :blk t; - log.warn("accounts.srf: account '{s}': audit_large_lot_threshold must be > 0 (got {d}); ignoring", .{ entry.account, t }); + // No-op under `zig build test`: the parser's own tests feed + // invalid thresholds (0, negative) on purpose to verify they + // are rejected, and the warn spam pollutes test output. + if (!builtin.is_test) + log.warn("accounts.srf: account '{s}': audit_large_lot_threshold must be > 0 (got {d}); ignoring", .{ entry.account, t }); break :blk null; } else null;