zig/test/behavior/struct_contains_null_ptr_itself.zig
Andrew Kelley 4307436b99 move behavior tests from test/stage1/ to test/
And fix test cases to make them pass. This is in preparation for
starting to pass behavior tests with self-hosted.
2021-04-29 15:54:04 -07:00

22 lines
395 B
Zig

const std = @import("std");
const expect = std.testing.expect;
test "struct contains null pointer which contains original struct" {
var x: ?*NodeLineComment = null;
expect(x == null);
}
pub const Node = struct {
id: Id,
comment: ?*NodeLineComment,
pub const Id = enum {
Root,
LineComment,
};
};
pub const NodeLineComment = struct {
base: Node,
};