Qi Xiao
fbf0bfc13b
pkg/sys: Double init size of stack trace buf.
...
4KB is likely insufficient.
2022-06-23 21:48:12 +01:00
Qi Xiao
6810de7384
pkg/shell: Clean up signal handling goroutine.
...
This is not necessary for actual uses of Elvish, but can leave a lot of
goroutines running in tests.
2022-06-23 21:48:12 +01:00
Qi Xiao
ed97664695
pkg/eval: Test the exit command by faking os.Exit.
2022-06-23 20:25:01 +01:00
Qi Xiao
7855bc0fd7
pkg/cli/modes: Improve nav mode test coverage.
2022-06-21 23:27:36 +01:00
Qi Xiao
75c230f5eb
pkg/cli/lscolors: Increase test coverage.
2022-06-20 23:24:11 +01:00
Qi Xiao
98ee4aebdd
pkg/cli/histutil: Ignore coverage of testDB.
2022-06-20 23:06:07 +01:00
Qi Xiao
e0292dd298
Get coverage on IsStructMap methods with a hack.
2022-06-20 22:08:19 +01:00
Qi Xiao
400ada5c86
pkg/logutil: Add tests.
2022-06-20 22:03:58 +01:00
Qi Xiao
af4ca7d75b
pkg/buildinfo: Improve test coverage.
2022-06-20 21:13:34 +01:00
Qi Xiao
4afbb71c07
Move pkg/testutil/must.go to a new pkg/must.
2022-06-20 20:29:14 +01:00
Qi Xiao
d2c005df45
pkg/eval: Test import of module with invalid UTF-8.
2022-06-20 00:14:25 +01:00
Qi Xiao
786b679509
pkg/eval: Cover more tilde expansion errors.
2022-06-20 00:08:33 +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
Qi Xiao
94e43cd2fd
pkg/eval: Add tests for errors in tilde expansion.
2022-06-19 23:34:36 +01:00
Qi Xiao
35e236aee7
pkg/shell: Add more scripting tests.
2022-06-19 22:45:24 +01:00
Qi Xiao
6a1e7b3996
pkg/shell: Add more daemon-related tests.
...
Also:
- Remove duplicate code for closing daemon client.
- Avoid using (*testing.T).TempDir - it uses test name in the path, which can
exceed the limit of the address when calling bind(2):
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html#tag_13_6
7_04
2022-06-19 21:45:36 +01:00
Qi Xiao
e06bf69a74
pkg/shell: Add tests for DB path.
2022-06-19 20:29:50 +01:00
Qi Xiao
78d914b24b
pkg/shell: Run TestInteract_ConnectsToDaemon on Windows too.
...
This test now succeeds on Windows too, now that the daemon also uses Unix
sockets on Windows.
2022-06-19 19:08:11 +01:00
Qi Xiao
a3cc6a44f0
pkg/daemon: Fix a comment.
2022-06-19 19:06:24 +01:00
Qi Xiao
3d0196b7d3
pkg/shell: De-export makeEvaler and incSHLVL.
...
Change the test cases against InvSHLVL to test the behavior of the Program
instead.
2022-06-19 15:43:23 +01:00
Qi Xiao
6cb2fd3855
Treat $XDG_DATA_DIRS as semicolon-delimited on Windows.
2022-06-19 14:41:25 +01:00
Qi Xiao
2506b578b9
pkg/shell: Test against XDG environment variables.
...
Also fix how $XDG_DATA_DIRS is handled.
2022-06-19 14:30:37 +01:00
Qi Xiao
75ee261fcb
pkg/eval: Remove access methods for exported fields.
...
The exported fields are intended to be mutated directly.
2022-06-18 19:01:59 +01:00
Qi Xiao
d48b6f1843
pkg/eval/vals: Replace MakeListFromStrings with a generic MakeListSlice.
2022-06-17 16:50:38 +01:00
Qi Xiao
01756ef57a
pkg/daemon: Ignore error when closing connections on shutdown.
...
The logs are not useful anyway since the reason is invariably that the client
has already closed the connection.
Moreover, timing in the shutdown sequence causes fluctuation in test coverage;
removing this log eliminates the fluctuation.
2022-06-14 21:01:50 +01:00
Qi Xiao
4a6405eeb4
pkg/edit/complete: Improve analysis of variable definitions.
...
- Remove the sigil from the variable name.
- Recognize function parameters too.
2022-06-14 20:50:57 +01:00
Qi Xiao
e0ee14ad68
Support completing variables defined in the code being completed.
2022-06-13 23:00:06 +01:00
Qi Xiao
534be70bfb
Simplify implementation of variable completion.
...
There is no need to enumerate namespaces separately, since namespaces are also
variables. The only exceptions are "e:" and "E:", which are handled as special
cases now.
2022-06-13 22:50:44 +01:00
Qi Xiao
6564b14898
Fix crash when completing code with unexpected rune.
...
This fixes #1530 .
2022-06-12 21:39:51 +01:00
Qi Xiao
f3ea882bd2
Warn about files in ~/.elvish instead of the directory itself.
2022-06-12 14:21:57 +01:00
Qi Xiao
ae9e6d1565
Fixup for #1531 .
...
- Fix the handling of actual occurrences of U+FFFD.
- Fix an existing bug of QuoteVariableName("$\n").
2022-06-11 21:26:32 +01:00
Kurtis Rader
d0f6858b95
Correctly encode strings with invalid UTF-8
...
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
2022-06-11 20:42:06 +01:00
Qi Xiao
49115dba1d
Respect $XDG_* directories on Windows.
...
This fixes #1481 .
2022-06-09 22:48:39 +01:00
Qi Xiao
cb8628bcb6
Print a warning if ~/.elvish exists as a directory.
...
This addresses #1554 .
2022-06-07 23:35:13 +01:00
Qi Xiao
68bce3b4a4
Clarify error message when writing values to port not supporting it.
...
This fixes #1516 .
2022-06-07 20:29:34 +01:00
Qi Xiao
f42c2dda61
Make init value of $f~ actually identical to $nop~.
...
This fixes #1519 .
2022-06-07 20:20:00 +01:00
Qi Xiao
5bf0290741
pkg/cli/term: Support surrogate pairs on Windows.
...
This fixes #1502 .
2022-06-06 23:12:54 +01:00
Qi Xiao
2c30cf9806
Fix staticcheck errors on Windows.
2022-06-05 22:46:24 +01:00
Qi Xiao
f043bd33fb
Fixup for #1549 .
2022-06-05 22:37:52 +01:00
Kurtis Rader
fa704d6ac6
Implement edit:command-abbr
...
It turns out that the "small word" abbreviation mechanism I added isn't
really what I, or most users, want. What users really want, at least
most of the time, is the Fish shell abbreviation behavior of expanding
an abbreviation only in the command head position.
Resolves #1472
2022-06-05 22:15:07 +01:00
Qi Xiao
8b0c7fdb36
Fix some lint warnings found on Windows.
2022-06-05 22:01:16 +01:00
Qi Xiao
d4dd11a981
pkg/eval/vars: Deexport EnvVariable, use Unset/IsSet via interface
2022-06-05 21:47:51 +01:00
Qi Xiao
26a66284a9
Fixup for #1551 .
2022-06-05 16:01:10 +01:00
Tw
d27610b3e4
Fix undefined temporary environment restoring issue
...
Close #1536
Signed-off-by: Tw <tw19881113@gmail.com>
2022-06-05 15:41:19 +01:00
Kurtis Rader
ee309bf1c6
Don't dot import pkg/parse
...
Qualified imports of pkg/parse outnumber unqualified (66 to 1). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.
2022-06-04 23:39:19 +01:00
Kurtis Rader
345c5c66dd
Don't dot import pkg/ui
...
Qualified imports of pkg/ui outnumber unqualified (82 to 1). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.
2022-06-04 23:39:19 +01:00
Kurtis Rader
71cd3835bc
Don't dot import pkg/tt
...
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.
2022-06-04 23:39:19 +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
3a4e7ce1fe
pkg/lsp: Populate completionProvider capability.
...
Needed for conforming clients to start requesting autocompletion.
2022-06-03 20:30:46 +01:00
Kurtis Rader
14321f9e82
Make parse.Source naming more consistent
...
Fixes #1545
2022-05-29 17:36:29 +01:00