Merge pull request #4971 from Vexu/const-ref
Fix missing const on address of literal
This commit is contained in:
@@ -1327,12 +1327,13 @@ test "Value.jsonStringify" {
|
||||
{
|
||||
var buffer: [10]u8 = undefined;
|
||||
var fbs = std.io.fixedBufferStream(&buffer);
|
||||
var vals = [_]Value{
|
||||
.{ .Integer = 1 },
|
||||
.{ .Integer = 2 },
|
||||
.{ .Integer = 3 },
|
||||
};
|
||||
try (Value{
|
||||
.Array = Array.fromOwnedSlice(undefined, &[_]Value{
|
||||
.{ .Integer = 1 },
|
||||
.{ .Integer = 2 },
|
||||
.{ .Integer = 3 },
|
||||
}),
|
||||
.Array = Array.fromOwnedSlice(undefined, &vals),
|
||||
}).jsonStringify(.{}, fbs.outStream());
|
||||
testing.expectEqualSlices(u8, fbs.getWritten(), "[1,2,3]");
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ pub const FailingAllocator = @import("testing/failing_allocator.zig").FailingAll
|
||||
pub const allocator = &allocator_instance.allocator;
|
||||
pub var allocator_instance = LeakCountAllocator.init(&base_allocator_instance.allocator);
|
||||
|
||||
pub const failing_allocator = &FailingAllocator.init(&base_allocator_instance.allocator, 0).allocator;
|
||||
pub const failing_allocator = &failing_allocator_instance.allocator;
|
||||
pub var failing_allocator_instance = FailingAllocator.init(&base_allocator_instance.allocator, 0);
|
||||
|
||||
pub var base_allocator_instance = std.heap.ThreadSafeFixedBufferAllocator.init(allocator_mem[0..]);
|
||||
var allocator_mem: [1024 * 1024]u8 = undefined;
|
||||
|
||||
Reference in New Issue
Block a user