zig/doc/langref/test_fn_reflection.zig

12 lines
386 B
Zig

const std = @import("std");
const math = std.math;
const testing = std.testing;
test "fn reflection" {
try testing.expectEqual(bool, @typeInfo(@TypeOf(testing.expect)).@"fn".params[0].type.?);
try testing.expectEqual(testing.TmpDir, @typeInfo(@TypeOf(testing.tmpDir)).@"fn".return_type.?);
try testing.expect(@typeInfo(@TypeOf(math.Log2Int)).@"fn".is_generic);
}
// test