A year ago I submitted a change to replace AnyError with tests for specific
errors (see https://github.com/elves/elvish/commit/87656c99). This does
something similar for DoesNotCompile. This ensures the test does what
is implied and makes correlating specific unit tests with compilation
errors easier.
This includes a couple of changes to compilation error messages to improve
readability (IMHO) but those are not the primary purpose of this change.
Related #1560
- Let file:is-tty always take one argument.
- Revert change to eval.ByteOutput.
- Make sys.IsATTY take a FD instead, to avoid the need to use os.NewFile. Using
os.NewFile can cause the Go runtime to start polling the file, which
interferes with Elvish's terminal reader.
- Keep more metrics than just the minimal duration.
- Change default &min-time to 1s.
- Don't allow unitless value as &min-time.
- Rename &on-run to &on-run-end, and &min-iters to &min-runs.
The method returns a message saying that there is no valid value if ValidHigh <
ValidLow. This was useful when these fields were numbers, but since they are now
strings this no longer works.
I noticed this when testing my `help` command and noticed that
`help builtin:` produced three lines of "usage" text that did not
include a function or variable name.
This is used in ttyshots to get deterministic outputs.
This command is prefixed with - since I'd like to eventually move rand and
randint into their own module, so this command will be moved too.
Styled text is not supposed to "inherit" the current SGR styling context when
written to the terminal. This has always been the intention, but not correctly
implemented. This commit fixes that for both styled segments and styled texts.
Tests are amended to account for the difference in the output.
With context insensitivity correctly implemented, there is now no need for a
"default" color. It is functionally equivalent to a lack of color.
The parsing of SGR still needs to be aware of the codes 39 (default foreground)
and 49 (default background), but these codes are now translated into FgDefault
and BgDefault, which resets the foreground and background color fields.
In addition to fixing the encoding bugs standardize on \xNN notation for
bytes rather than \uNNNN; e.g., \x00 rather than \u0000.
Also, update the documentation for double-quoted strings to include the
\e sequence.
Fixes#1528
Qualified imports of pkg/tt outnumber unqualified (27 to 24). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.
Qualified imports of pkg/testutil outnumber unqualified (55 to 7). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.