From 35f18e584fae890f686eafcdc12a2fde6281206d Mon Sep 17 00:00:00 2001 From: Sam Atman Date: Tue, 29 Apr 2025 15:32:58 -0400 Subject: Add general tests step After a considerable slog, all tests are reachable from the test step, and pass. Almost every failure was related to the change away from the inclusion of an allocator on this or that. --- src/DisplayWidth.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/DisplayWidth.zig') diff --git a/src/DisplayWidth.zig b/src/DisplayWidth.zig index 04e6b0c..8631bd4 100644 --- a/src/DisplayWidth.zig +++ b/src/DisplayWidth.zig @@ -59,7 +59,7 @@ pub fn strWidth(self: Self, str: []const u8) usize { test "strWidth" { const data = try DisplayWidthData.init(testing.allocator); - defer data.deinit(); + defer data.deinit(testing.allocator); const self = Self{ .data = &data }; const c0 = options.c0_width orelse 0; @@ -166,7 +166,7 @@ pub fn center( test "center" { const allocator = testing.allocator; const data = try DisplayWidthData.init(allocator); - defer data.deinit(); + defer data.deinit(allocator); const self = Self{ .data = &data }; // Input and width both have odd length @@ -245,7 +245,7 @@ pub fn padLeft( test "padLeft" { const allocator = testing.allocator; const data = try DisplayWidthData.init(allocator); - defer data.deinit(); + defer data.deinit(allocator); const self = Self{ .data = &data }; var right_aligned = try self.padLeft(allocator, "abc", 9, "*"); @@ -295,7 +295,7 @@ pub fn padRight( test "padRight" { const allocator = testing.allocator; const data = try DisplayWidthData.init(allocator); - defer data.deinit(); + defer data.deinit(allocator); const self = Self{ .data = &data }; var left_aligned = try self.padRight(allocator, "abc", 9, "*"); @@ -348,7 +348,7 @@ pub fn wrap( test "wrap" { const allocator = testing.allocator; const data = try DisplayWidthData.init(allocator); - defer data.deinit(); + defer data.deinit(allocator); const self = Self{ .data = &data }; const input = "The quick brown fox\r\njumped over the lazy dog!"; -- cgit v1.2.3