aboutsummaryrefslogtreecommitdiff
path: root/lib/std/testing.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-03-13 15:56:09 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-03-21 14:11:46 -0700
commit12191c8a220ca5594b278b5077bff98e8fecac08 (patch)
treece6552d68161c363dd18826220febbaa7f733c62 /lib/std/testing.zig
parent5ae838d10596a272644da314937b01aa1a271a73 (diff)
downloadzig-12191c8a220ca5594b278b5077bff98e8fecac08.tar.gz
zig-12191c8a220ca5594b278b5077bff98e8fecac08.zip
std: promote tests to doctests
Now these show up as "example usage" in generated documentation.
Diffstat (limited to 'lib/std/testing.zig')
-rw-r--r--lib/std/testing.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/testing.zig b/lib/std/testing.zig
index c6a4f9f78f..2d97580a22 100644
--- a/lib/std/testing.zig
+++ b/lib/std/testing.zig
@@ -242,7 +242,7 @@ fn expectApproxEqAbsInner(comptime T: type, expected: T, actual: T, tolerance: T
}
}
-test "expectApproxEqAbs" {
+test expectApproxEqAbs {
inline for ([_]type{ f16, f32, f64, f128 }) |T| {
const pos_x: T = 12.0;
const pos_y: T = 12.06;
@@ -278,7 +278,7 @@ fn expectApproxEqRelInner(comptime T: type, expected: T, actual: T, tolerance: T
}
}
-test "expectApproxEqRel" {
+test expectApproxEqRel {
inline for ([_]type{ f16, f32, f64, f128 }) |T| {
const eps_value = comptime math.floatEps(T);
const sqrt_eps_value = comptime @sqrt(eps_value);