...

Text file src/golang.org/x/tools/cmd/bisect/testdata/README.md

Documentation: golang.org/x/tools/cmd/bisect/testdata

     1This directory contains test inputs for the bisect command.
     2
     3Each text file is a txtar archive (see <https://pkg.go.dev/golang.org/x/tools/txtar>
     4or `go doc txtar`).
     5
     6The comment at the top of the archive is a JSON object describing a
     7target behavior. Specifically, the Fail key gives a boolean expression
     8that should provoke a failure. Bisect's job is to discover this
     9condition.
    10
    11The Bisect key describes settings in the Bisect struct that we want to
    12change, to simulate the use of various command-line options.
    13
    14The txtar archive files should be "stdout" and "stderr", giving the
    15expected standard output and standard error. If the bisect command
    16should exit with a non-zero status, the stderr in the archive will end
    17with the line "<bisect failed>".
    18
    19Running `go test -update` will rewrite the stdout and stderr files in
    20each testdata archive to match the current state of the tool. This is
    21a useful command when the logging prints from bisect change or when
    22writing a new test.
    23
    24To use `go test -update` to write a new test:
    25
    26 - Create a new .txt file with just a JSON object at the top,
    27   specifying what you want to test.
    28 - Run `go test -update`.
    29 - Reload the .txt file and read the stdout and stderr to see if you agree.

View as plain text