Text file src/cmd/go/testdata/script/script_wait.txt

     1  env GO111MODULE=off
     2  
     3  [!exec:echo] skip
     4  [!exec:false] skip
     5  
     6  exec echo foo
     7  stdout foo
     8  
     9  exec echo foo &
    10  exec echo bar &
    11  ! exec false &
    12  
    13  # Starting a background process should clear previous output.
    14  ! stdout foo
    15  
    16  # Wait should set the output to the concatenated outputs of the background
    17  # programs, in the order in which they were started.
    18  wait
    19  stdout 'foo\nbar'
    20  
    21  # The end of the test should interrupt or kill any remaining background
    22  # programs, but that should not cause the test to fail if it does not
    23  # care about the exit status of those programs.
    24  [exec:sleep] ? exec sleep 86400 &
    25  
    26  # It should also cancel any backgrounded builtins that respond to Context
    27  # cancellation.
    28  ? sleep 86400s &
    29  

View as plain text