Skip to content

Commit 196d7c7

Browse files
committed
tests: add status test
1 parent a596dc1 commit 196d7c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ziglua.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ pub const Lua = struct {
884884
c.lua_setwarnf(lua.state, warn_fn, data);
885885
}
886886

887+
// TODO: this is not very clean
887888
pub const StatusType = enum(u3) {
888889
ok = Status.ok,
889890
yield = Status.yield,
@@ -1801,6 +1802,7 @@ fn failing_alloc(data: ?*anyopaque, ptr: ?*anyopaque, osize: usize, nsize: usize
18011802
test "initialization" {
18021803
// initialize the Zig wrapper
18031804
var lua = try Lua.init(testing.allocator);
1805+
try expectEqual(Lua.StatusType.ok, lua.status());
18041806
lua.deinit();
18051807

18061808
// attempt to initialize the Zig wrapper with no memory
@@ -2434,7 +2436,6 @@ test "refs" {
24342436
_ = Lua.setMetatable;
24352437
_ = Lua.setTable;
24362438
_ = Lua.setWarnF;
2437-
_ = Lua.status;
24382439
_ = Lua.toClose;
24392440
_ = Lua.toPointer;
24402441
_ = Lua.toUserdata;

0 commit comments

Comments
 (0)