2019-08-28 05:39:06 +08:00
|
|
|
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 {
|
2021-05-05 02:23:22 +08:00
|
|
|
expect(p == null) catch @panic("test failure");
|
2019-08-28 05:39:06 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
test "zig test crash" {
|
|
|
|
var global: State = undefined;
|
|
|
|
global.enter = prev;
|
|
|
|
global.enter(null);
|
|
|
|
}
|