...

Text file src/github.com/rogpeppe/go-internal/testscript/testdata/wait.txt

Documentation: github.com/rogpeppe/go-internal/testscript/testdata

     1[!exec:echo] skip
     2[!exec:false] skip
     3
     4# TODO: the '\n' below doesn't work on Windows on Github Actions, which does
     5# have coreutils like "echo" installed. Perhaps they emit CRLF?
     6[windows] skip
     7
     8exec echo foo
     9stdout foo
    10
    11exec echo foo &
    12exec echo bar &
    13! exec false &
    14
    15# Starting a background process should clear previous output.
    16! stdout foo
    17
    18# Wait should set the output to the concatenated outputs of the background
    19# programs, in the order in which they were started.
    20wait
    21stdout 'foo\nbar'
    22
    23exec echo bg1 &b1&
    24exec echo bg2 &b2&
    25exec echo bg3 &b3&
    26exec echo bg4 &b4&
    27
    28wait b3
    29stdout bg3
    30wait b2
    31stdout bg2
    32wait
    33stdout 'bg1\nbg4'
    34
    35# We should be able to start several background processes and wait for them
    36# individually.
    37
    38# The end of the test should interrupt or kill any remaining background
    39# programs.
    40[!exec:sleep] skip
    41! exec sleep 86400 &

View as plain text