test_setup()
{
    # We expect truncation after 1000 bytes. However, we can't create a
    # file with a name that long on some filesystems, so we ask for a
    # simple "foo.cgi" and pass the rest as a parameter.
    printf -v aaa 'a%.s' {1..2000}
    printf -v request '/foo.cgi\t%s\r\n' "$aaa"

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

read
printf '%s' "\$REPLY"
EOF
    chmod +x "$docroot"/foo.cgi
}

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

    # 991 = 1000 - len(/) - len(foo.cgi) - len(\t)
    printf 'a%.s' {1..991} >"$work"/stdout.expected
}
