Skip to content

Commit e677c41

Browse files
Use assert instead of echo in examples
Co-Authored-By: Juan Carlos <[email protected]>
1 parent 5827927 commit e677c41

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/system/channels.nim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
## createThread(worker1, firstWorker)
6161
##
6262
## # Block until the message arrives, then print it out.
63-
## echo chan.recv() # "Hello World!"
63+
## assert chan.recv() == "Hello World!"
6464
##
6565
## # Wait for the thread to exit before moving on to the next example.
6666
## worker1.joinThread()
@@ -74,7 +74,7 @@
7474
## while true:
7575
## let tried = chan.tryRecv()
7676
## if tried.dataAvailable:
77-
## echo tried.msg # "Another message"
77+
## assert tried.msg == "Another message"
7878
## break
7979
##
8080
## echo "Pretend I'm doing useful work..."
@@ -450,4 +450,3 @@ proc ready*[TMsg](c: var Channel[TMsg]): bool =
450450
## new messages.
451451
var q = cast[PRawChannel](addr(c))
452452
result = q.ready
453-

0 commit comments

Comments
 (0)