Commit Graph

20 Commits

Author SHA1 Message Date
Qi Xiao
0adf0ec147 Use the unix build tag.
The unix build tag is supported by Go 1.19.
2023-03-03 00:01:26 +00:00
Qi Xiao
de3a7fd1b3 Standardize spelling: UNIX -> Unix.
https://en.wikipedia.org/wiki/Unix#Branding contains a history of the spelling.
Follow Wikipedia in using Unix instead of UNIX.
2023-01-04 18:09:11 +00:00
Qi Xiao
4afbb71c07 Move pkg/testutil/must.go to a new pkg/must. 2022-06-20 20:29:14 +01:00
Qi Xiao
6723b9a226 Use consistent pattern for mutating variables in tests.
- Use testutil.Set.

- Only export such variables to tests.
2022-06-19 23:56:18 +01:00
Kurtis Rader
f681a73a1d Don't dot import pkg/testutil
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.
2022-06-04 23:39:19 +01:00
Qi Xiao
f7cb556d9b Require Go 1.18.
- Run "go fix" to remove legacy build tags

- Use staticcheck@master until it has a release that supports Go 1.18

- Turn off autocrlf for Windows tasks
2022-03-20 15:28:23 +00:00
Qi Xiao
e85afa2cbe Fixup for PR #1499.
- Use filepath.Ext instead of path.Ext

- Use cmp.Diff to generate test failure messages

- Misc stylistic changes
2022-03-12 23:22:34 +00:00
Kurtis Rader
603aae077d Improve searching PATH on Windows for completions
This was extracted from https://github.com/elves/elvish/pull/1326. It
augments that change by honoring $E:PATHEXT and some other
minor improvements.  This matches the behavior of the Go stdlib
os/exec.LookPath() function that is used to decide if what has been typed
(in a non-completion context) represents an external command.
2022-03-12 22:49:52 +00:00
Qi Xiao
ff0d1f9ca5 Fixup for #1394
- Do not ignore errors from os.ReadDir

- Call results from os.ReadDir "files" instead of "infos"
2021-08-30 09:02:06 +01:00
Kurtis Rader
383b083760 Replace remaining deprecated ioutil.ReadDir uses
Resolves #1350
2021-08-30 08:57:34 +01:00
Qi Xiao
d0be34c227 Run gofmt with Go 1.17.
This has created a lot of //go:build lines.
2021-08-23 00:19:49 +01:00
Qi Xiao
e9d328aa16 Make use of (*testing.T).Cleanup for test cleanups.
This allows turning the following pattern in tests:

  value, cleanup := setupSomething()
  defer cleanup()

into the following:

  value := setupSomething(t)
2021-08-06 23:21:23 +01:00
Qi Xiao
196eea21d4 Change module import path to src.elv.sh 2021-01-27 01:30:25 +00:00
Qi Xiao
a1cde7b77b pkg/fsutil: Fix claim_test.go for Windows. 2021-01-17 00:55:51 +00:00
Qi Xiao
f530a71afc pkg/fsutil: Add more tests for ClaimFile.
The test for concurrent calls uncovered a bug where concurrent calls could
return the same file; fix this by adding a O_EXCL flag.
2021-01-17 00:11:38 +00:00
Kurtis Rader
d241243fdf Ensure the daemon doesn't have fds open on the tty
The Elvish daemon should not inherit file descriptors open on the tty.
Make the daemon's stdin open on the null device and its stdout/stderr
open on a predictable file.

Fixes #1191
2021-01-16 23:18:38 +00:00
Kurtis Rader
a943dc764a Improve navigation mode corner cases
There are some Navigation mode corner cases whose current behavior is
surprising. Such as inserting a space before the filename when the space
isn't wanted or redundant. Also, selecting an empty directory and pressing
Enter should insert nothing rather than an empty string.

Fixes #1169
2020-11-07 13:17:00 -05:00
Qi Xiao
bd1348e6c8 pkg/fsutil: Add correct build tag to search_unix_test.go. 2020-09-04 22:36:52 +01:00
Qi Xiao
b986d80a49 pkg/eval: Move EachExternal to the fsutil package. 2020-09-04 22:04:20 +01:00
Qi Xiao
11898f763a pkg/util: Break into fsutil/ and logutil/. 2020-09-03 05:27:18 +01:00