test::func_getchildpids() {
  local pids=()
  func::getchildpids pids
  EXPECT_EQ 0 "${#pids[*]}"

  sleep 10 &
  local child_pid="$!"
  func::getchildpids pids
  EXPECT_EQ 1 "${#pids[*]}"

  kill -9 "${child_pid}"
}

test::func_getchildpids() {
  local pids=()
  func::getchildpids pids
  EXPECT_TRUE [ "${#pids[*]}" -le 1 ]

  local child_pids=()
  for i in {1..10}; do
    sleep 10 &
    child_pids+=("$!")
  done
  func::getchildpids pids
  EXPECT_TRUE [ "${#pids[*]}" -ge 10 -a "${#pids[*]}" -le 11 ]

  for child_pid in "${child_pids[@]}"; do
    kill -9 "${child_pid}"
  done
}

Make getchildpids' test have margins.
Make getchildpids' test have margins.
