milestone 24: persist and surface the unsupported-line count

This commit is contained in:
2026-08-13 20:44:27 +02:00
parent 21571e448e
commit 1bce81eea0
18 changed files with 799 additions and 20 deletions
+14 -1
View File
@@ -61,6 +61,7 @@ pub const StatusView = struct {
wildcards: u32,
exceptions: u32,
skipped_regex: u32,
skipped_unsupported: u32,
pub fn from(status: *const manager_mod.SourceStatus) StatusView {
return .{
@@ -75,6 +76,7 @@ pub const StatusView = struct {
.wildcards = status.counts.wildcards,
.exceptions = status.counts.exceptions,
.skipped_regex = status.counts.skipped_regex,
.skipped_unsupported = status.counts.skipped_unsupported,
};
}
};
@@ -321,6 +323,7 @@ test "editing a blocklist keeps the counters the refresh wrote" {
.wildcard_count = 3,
.exception_count = 2,
.skipped_regex_count = 1,
.skipped_unsupported_count = 8,
.checksum = "abc",
});
@@ -335,6 +338,8 @@ test "editing a blocklist keeps the counters the refresh wrote" {
try testing.expectEqualStrings("renamed", row.name);
try testing.expect(!row.enabled);
try testing.expectEqual(@as(i64, 42), row.domain_count);
try testing.expectEqual(@as(i64, 1), row.skipped_regex_count);
try testing.expectEqual(@as(i64, 8), row.skipped_unsupported_count);
try testing.expectEqual(@as(usize, 2), bench.reloads);
}
@@ -383,7 +388,13 @@ test "a status becomes the flat shape the API answers with" {
const message = "connection refused";
@memcpy(status.last_error[0..message.len], message);
status.last_error_len = message.len;
status.counts = .{ .domains = 10, .wildcards = 2, .exceptions = 4, .skipped_regex = 1 };
status.counts = .{
.domains = 10,
.wildcards = 2,
.exceptions = 4,
.skipped_regex = 1,
.skipped_unsupported = 6,
};
const view: StatusView = .from(&status);
try testing.expectEqual(@as(i64, 7), view.id);
@@ -393,4 +404,6 @@ test "a status becomes the flat shape the API answers with" {
try testing.expectEqualStrings(message, view.last_error);
try testing.expectEqual(@as(u32, 10), view.domains);
try testing.expectEqual(@as(u32, 4), view.exceptions);
try testing.expectEqual(@as(u32, 1), view.skipped_regex);
try testing.expectEqual(@as(u32, 6), view.skipped_unsupported);
}