test_setup()
{
    request=$'/foo.dcgi\r\n'

    cat >"$docroot"/foo.dcgi <<EOF
#!/bin/sh

cat <<NESTED
Welcome!

Have fun browsing this server.

[0|About this server|about.txt|server|port]
[0|A quote|/random/quote.txt|server|port]
[1|Pics|/pics|server|port]
[1|My friend's server|/foo|friend.org|70]
[h|A web page|!URL:http://www.example.com|server|port]
NESTED
EOF
}

test_set_assumptions()
{
    echo 0 >"$work"/exitcode.expected
    touch "$work"/stderr.expected

    # The script is not marked as executable, so we expect that it will
    # be sent verbatim (without being interpreted).
    cat >"$work"/stdout.expected <<EOF
#!/bin/sh

cat <<NESTED
Welcome!

Have fun browsing this server.

[0|About this server|about.txt|server|port]
[0|A quote|/random/quote.txt|server|port]
[1|Pics|/pics|server|port]
[1|My friend's server|/foo|friend.org|70]
[h|A web page|!URL:http://www.example.com|server|port]
NESTED
EOF
}
