From 10048b0d31d0db923ae39c6bbd67139ed6252f6f Mon Sep 17 00:00:00 2001 From: Sam Atman Date: Wed, 30 Apr 2025 20:30:39 -0400 Subject: Allocation Failure Tests These turned up an excessive amount of allocations in CanonData and CompatData, which have been reduced to two through the somewhat squirrely use of 'magic numbers'. There are now allocation tests for every allocated structure in the library, and they run to completion in a reasonable amount of time. So, that's nice. --- src/CaseFolding.zig | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/CaseFolding.zig') diff --git a/src/CaseFolding.zig b/src/CaseFolding.zig index 2e53bfa..f63b860 100644 --- a/src/CaseFolding.zig +++ b/src/CaseFolding.zig @@ -310,14 +310,13 @@ fn testAllocations(allocator: Allocator) !void { } } -// test "Allocation Failures" { -// if (true) return error.SkipZigTest; // XXX: remove -// try testing.checkAllAllocationFailures( -// testing.allocator, -// testAllocations, -// .{}, -// ); -// } +test "Allocation Failures" { + try testing.checkAllAllocationFailures( + testing.allocator, + testAllocations, + .{}, + ); +} const std = @import("std"); const builtin = @import("builtin"); -- cgit v1.2.3