lune/tests/ffi/pretty_print/struct.luau
2024-11-09 12:46:20 +00:00

8 lines
256 B
Text

local ffi = require("@lune/ffi")
local c = ffi.c
assert(typeof(c.struct({ c.int, c.char })) :: string == "CStructInfo")
assert(
tostring(c.struct({ c.int, c.char:ptr() }))
== ` int, <CPtrInfo(char)>, size = {c.struct({ c.int, c.char:ptr() }).size} `
)