# file      : tests/test/script/builtin/sleep.testscript
# license   : MIT; see accompanying LICENSE file

.include ../common.testscript

: success
:
$c <'sleep 1' && $b

: timeout
:
{
  : failure
  :
  $c <'env -t 1 -- sleep 86400' && $b 2>>~%EOE% != 0
    %testscript:.*: error: builtin sleep terminated: execution timeout expired%
    %.
    EOE

  : success
  :
  $c <<EOI && $b
    timeout --success 1;
    sleep 86400
    EOI
}
