aboutsummaryrefslogtreecommitdiff
path: root/std/buffer.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-05-27 19:21:17 -0400
committerGitHub <noreply@github.com>2019-05-27 19:21:17 -0400
commit6a56091213a48118c8c61c0683466f0ffadf6b55 (patch)
tree02289065efbdca8241f78cb195eeddb20b59a2aa /std/buffer.zig
parentdf7aa9a4f0360945db999f6a6190290eb91d6351 (diff)
parent3640303ce1585f266f94e2c815287cb590478e0d (diff)
downloadzig-6a56091213a48118c8c61c0683466f0ffadf6b55.tar.gz
zig-6a56091213a48118c8c61c0683466f0ffadf6b55.zip
Merge pull request #2527 from ziglang/posix-layer
rework the API layers between the standard library and the operating system
Diffstat (limited to 'std/buffer.zig')
-rw-r--r--std/buffer.zig4
1 files changed, 1 insertions, 3 deletions
diff --git a/std/buffer.zig b/std/buffer.zig
index 32228af558..bc6aa254da 100644
--- a/std/buffer.zig
+++ b/std/buffer.zig
@@ -139,15 +139,13 @@ pub const Buffer = struct {
};
test "simple Buffer" {
- const cstr = @import("cstr.zig");
-
var buf = try Buffer.init(debug.global_allocator, "");
testing.expect(buf.len() == 0);
try buf.append("hello");
try buf.append(" ");
try buf.append("world");
testing.expect(buf.eql("hello world"));
- testing.expect(mem.eql(u8, cstr.toSliceConst(buf.toSliceConst().ptr), buf.toSliceConst()));
+ testing.expect(mem.eql(u8, mem.toSliceConst(u8, buf.toSliceConst().ptr), buf.toSliceConst()));
var buf2 = try Buffer.initFromBuffer(buf);
testing.expect(buf.eql(buf2.toSliceConst()));