mirror of
https://github.com/ziglang/zig.git
synced 2026-01-10 01:15:14 +00:00
And fix test cases to make them pass. This is in preparation for starting to pass behavior tests with self-hosted.
18 lines
317 B
Zig
18 lines
317 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
const State = struct {
|
|
const Self = @This();
|
|
enter: fn (previous: ?Self) void,
|
|
};
|
|
|
|
fn prev(p: ?State) void {
|
|
expect(p == null);
|
|
}
|
|
|
|
test "zig test crash" {
|
|
var global: State = undefined;
|
|
global.enter = prev;
|
|
global.enter(null);
|
|
}
|