summary refs log tree commit diff stats
path: root/tests/async/tmultisync.nim
blob: 9ef9b105c93d9d435d4c7069e40ec10e527ab3ac (plain) (blame)
1
2
3
4
5
6
7
8
import asyncdispatch, net, asyncnet

proc recvTwice(socket: Socket | AsyncSocket,
               size: int): Future[string] {.multisync.} =
  var x = await socket.recv(size)
  var y = await socket.recv(size+1)
  return x & "aboo" & y
an>; do [[ "$(decimal-to-earth_test-${i} $n)" == "$(decimal-to-earth_test-${i}_stable $n)" ]] || echo "[X] failed: decimal-to-earth_test-${i} $n" ; done; echo " * decimal-to-earth_test-${i} clean"; done for i in {1..6}; do for n in {1..1000}; do num=$(decimal-to-earth_test-${i} ${n}); [[ "$(earth-to-decimal_test-${i} ${num})" == "$(earth-to-decimal_test-${i}_stable ${num})" ]] || echo "[X] failed: earth-to-decimal_test-${i} ${num}" ; done; echo " * earth-to-decimal_test-${i} clean"; done echo echo "----" echo -e "----\n * void: decimal-to-earth_test-1 0 -> " $([[ "$(decimal-to-earth_test-1 0)" == "$(decimal-to-earth_test-1_stable 0)" ]] && echo clean || echo failed) echo "----" echo -e "----\n * out of domain: decimal-to-earth_test-1 abc -> " $([[ "$(decimal-to-earth_test-1 abc)" == "$(decimal-to-earth_test-1_stable abc)" ]] && echo clean || echo failed)