diff options
| author | William Boman <william@redwill.se> | 2022-05-17 23:15:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-17 23:15:36 +0200 |
| commit | 0e90f04651388df2477400b4b63e5443fcda43af (patch) | |
| tree | 82626e8193cdbf9406176fa6a7ff85f565698eb7 /tests/core/spawn_spec.lua | |
| parent | fix(omnisharp): remove invalid equality check (diff) | |
| download | mason-0e90f04651388df2477400b4b63e5443fcda43af.tar mason-0e90f04651388df2477400b4b63e5443fcda43af.tar.gz mason-0e90f04651388df2477400b4b63e5443fcda43af.tar.bz2 mason-0e90f04651388df2477400b4b63e5443fcda43af.tar.lz mason-0e90f04651388df2477400b4b63e5443fcda43af.tar.xz mason-0e90f04651388df2477400b4b63e5443fcda43af.tar.zst mason-0e90f04651388df2477400b4b63e5443fcda43af.zip | |
fix(spawn): avoid spawning commands that aren't on PATH (#706)
This is primarily done to avoid cluttering the log file with a bunch of
ERROR entries. Also avoids unnecessary roundtrips to uv_spawn, I guess.
Diffstat (limited to 'tests/core/spawn_spec.lua')
| -rw-r--r-- | tests/core/spawn_spec.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/core/spawn_spec.lua b/tests/core/spawn_spec.lua index b3dfce35..c7b4f320 100644 --- a/tests/core/spawn_spec.lua +++ b/tests/core/spawn_spec.lua @@ -153,10 +153,22 @@ describe("async spawn", function() callback(false, 127) end) + local result = spawn.bash {} + assert.is_true(result:is_failure()) + assert.equals( + "spawn: bash failed with exit code 127. This is an error message for bash!", + tostring(result:err_or_nil()) + ) + end) + ) + + it( + "should skip checking executable", + async_test(function() local result = spawn.my_cmd {} assert.is_true(result:is_failure()) assert.equals( - "spawn: my_cmd failed with exit code 127. This is an error message for my_cmd!", + "spawn: my_cmd failed with no exit code. my_cmd is not executable", tostring(result:err_or_nil()) ) end) |
