clean up references to os

This commit is contained in:
Andrew Kelley
2019-05-26 13:17:34 -04:00
parent 7cb6279ac0
commit 2f040a23c8
39 changed files with 648 additions and 640 deletions

View File

@@ -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()));