aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread
diff options
context:
space:
mode:
authorRyan Liptak <squeek502@hotmail.com>2024-02-26 15:14:43 -0800
committerRyan Liptak <squeek502@hotmail.com>2024-02-26 15:18:31 -0800
commit726a1149e05669e5cc05a16ce877bbb2be787e39 (patch)
tree0f5ae1dd819410e2b88def157161141fd79c8b6a /lib/std/Thread
parent16b3d1004ee520341839305826fe065eb5d8c818 (diff)
downloadzig-726a1149e05669e5cc05a16ce877bbb2be787e39.tar.gz
zig-726a1149e05669e5cc05a16ce877bbb2be787e39.zip
Change many test blocks to doctests/decltests
Diffstat (limited to 'lib/std/Thread')
-rw-r--r--lib/std/Thread/Condition.zig4
-rw-r--r--lib/std/Thread/Semaphore.zig4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/Thread/Condition.zig b/lib/std/Thread/Condition.zig
index 5c436261a8..b1154f8bd0 100644
--- a/lib/std/Thread/Condition.zig
+++ b/lib/std/Thread/Condition.zig
@@ -362,7 +362,7 @@ test "wait and signal" {
}
}
-test "signal" {
+test signal {
// This test requires spawning threads
if (builtin.single_threaded) {
return error.SkipZigTest;
@@ -491,7 +491,7 @@ test "multi signal" {
}
}
-test "broadcasting" {
+test broadcast {
// This test requires spawning threads
if (builtin.single_threaded) {
return error.SkipZigTest;
diff --git a/lib/std/Thread/Semaphore.zig b/lib/std/Thread/Semaphore.zig
index 47dccea6df..a82ae3d002 100644
--- a/lib/std/Thread/Semaphore.zig
+++ b/lib/std/Thread/Semaphore.zig
@@ -71,7 +71,7 @@ pub fn post(sem: *Semaphore) void {
sem.cond.signal();
}
-test "Semaphore" {
+test Semaphore {
if (builtin.single_threaded) {
return error.SkipZigTest;
}
@@ -97,7 +97,7 @@ test "Semaphore" {
try testing.expect(n == num_threads);
}
-test "timedWait" {
+test timedWait {
var sem = Semaphore{};
try testing.expectEqual(0, sem.permits);