aboutsummaryrefslogtreecommitdiff
path: root/doc/langref/test_fn_reflection.zig
blob: cc4dd50b334081cd7204d7dc0efa72f3f0f41fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
const std = @import("std");
const math = std.math;
const testing = std.testing;

test "fn reflection" {
    try testing.expect(@typeInfo(@TypeOf(testing.expect)).@"fn".params[0].type.? == bool);
    try testing.expect(@typeInfo(@TypeOf(testing.tmpDir)).@"fn".return_type.? == testing.TmpDir);

    try testing.expect(@typeInfo(@TypeOf(math.Log2Int)).@"fn".is_generic);
}

// test