Skip to content

Commit

Permalink
Use assert instead of echo in examples
Browse files Browse the repository at this point in the history
Co-Authored-By: Juan Carlos <juancarlospaco@gmail.com>
  • Loading branch information
chr-1x and juancarlospaco authored Jan 20, 2020
1 parent 5827927 commit e677c41
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/system/channels.nim
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
## createThread(worker1, firstWorker)
##
## # Block until the message arrives, then print it out.
## echo chan.recv() # "Hello World!"
## assert chan.recv() == "Hello World!"
##
## # Wait for the thread to exit before moving on to the next example.
## worker1.joinThread()
Expand All @@ -74,7 +74,7 @@
## while true:
## let tried = chan.tryRecv()
## if tried.dataAvailable:
## echo tried.msg # "Another message"
## assert tried.msg == "Another message"
## break
##
## echo "Pretend I'm doing useful work..."
Expand Down Expand Up @@ -450,4 +450,3 @@ proc ready*[TMsg](c: var Channel[TMsg]): bool =
## new messages.
var q = cast[PRawChannel](addr(c))
result = q.ready

0 comments on commit e677c41

Please sign in to comment.