mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
Use expectEqualSlices instead of loop
This commit is contained in:
parent
da8e8b89e0
commit
d86b8663fc
@ -836,11 +836,7 @@ test "std.ArrayList/ArrayListUnmanaged.clone" {
|
|||||||
const cloned = try array.clone();
|
const cloned = try array.clone();
|
||||||
defer cloned.deinit();
|
defer cloned.deinit();
|
||||||
|
|
||||||
var i: usize = 0;
|
try testing.expectEqualSlices(i32, array.items, cloned.items);
|
||||||
while (i < array.items.len) : (i += 1) {
|
|
||||||
try testing.expectEqual(array.items[i], cloned.items[i]);
|
|
||||||
}
|
|
||||||
try testing.expectEqual(array.items.len, cloned.items.len);
|
|
||||||
try testing.expectEqual(array.capacity, cloned.capacity);
|
try testing.expectEqual(array.capacity, cloned.capacity);
|
||||||
try testing.expectEqual(array.allocator, cloned.allocator);
|
try testing.expectEqual(array.allocator, cloned.allocator);
|
||||||
|
|
||||||
@ -859,11 +855,7 @@ test "std.ArrayList/ArrayListUnmanaged.clone" {
|
|||||||
var cloned = try array.clone(a);
|
var cloned = try array.clone(a);
|
||||||
defer cloned.deinit(a);
|
defer cloned.deinit(a);
|
||||||
|
|
||||||
var i: usize = 0;
|
try testing.expectEqualSlices(i32, array.items, cloned.items);
|
||||||
while (i < array.items.len) : (i += 1) {
|
|
||||||
try testing.expectEqual(array.items[i], cloned.items[i]);
|
|
||||||
}
|
|
||||||
try testing.expectEqual(array.items.len, cloned.items.len);
|
|
||||||
try testing.expectEqual(array.capacity, cloned.capacity);
|
try testing.expectEqual(array.capacity, cloned.capacity);
|
||||||
|
|
||||||
array.deinit(a);
|
array.deinit(a);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user