zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

test_fn_reflection.zig (380B) - Raw


      1 const std = @import("std");
      2 const math = std.math;
      3 const testing = std.testing;
      4 
      5 test "fn reflection" {
      6     try testing.expect(@typeInfo(@TypeOf(testing.expect)).@"fn".params[0].type.? == bool);
      7     try testing.expect(@typeInfo(@TypeOf(testing.tmpDir)).@"fn".return_type.? == testing.TmpDir);
      8 
      9     try testing.expect(@typeInfo(@TypeOf(math.Log2Int)).@"fn".is_generic);
     10 }
     11 
     12 // test