sometimes: don't report reachableSometimes in the N/M form

This commit is contained in:
2026-06-19 17:03:55 +02:00
parent 93b4efbb2f
commit 2c5afbd283
+13
View File
@@ -229,6 +229,18 @@ pub const Sometimes = struct {
std.debug.print("\n=== Sometimes assertions: {d}/{d} taken ===\n", .{ taken, self.entries.items.len }); std.debug.print("\n=== Sometimes assertions: {d}/{d} taken ===\n", .{ taken, self.entries.items.len });
for (self.entries.items) |entry| { for (self.entries.items) |entry| {
// A reachable site has no meaningful condition, so its true/eval
// ratio is always N/N; print just the hit count. An assert site's
// ratio shows how often the condition held, which is useful.
if (std.mem.eql(u8, entry.kind_name, "reachable")) {
std.debug.print(" [{d}] {s}:{d}:{d} ({s})", .{
entry.true_count,
entry.file,
entry.line,
entry.column,
entry.fn_name,
});
} else {
std.debug.print(" [{d}/{d}] {s}:{d}:{d} ({s})", .{ std.debug.print(" [{d}/{d}] {s}:{d}:{d} ({s})", .{
entry.true_count, entry.true_count,
entry.eval_count, entry.eval_count,
@@ -237,6 +249,7 @@ pub const Sometimes = struct {
entry.column, entry.column,
entry.fn_name, entry.fn_name,
}); });
}
if (entry.label) |label| if (entry.label) |label|
std.debug.print(" \"{s}\"", .{label}); std.debug.print(" \"{s}\"", .{label});
std.debug.print("\n", .{}); std.debug.print("\n", .{});