diff options
| author | William Boman <william@redwill.se> | 2023-10-13 17:05:12 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2025-02-19 09:23:19 +0100 |
| commit | 80944cbf22e10a4debe59d2f0166fb0cd7b1b1aa (patch) | |
| tree | 9abe9afe34923fce89d6b9b90a1b41445a4d1cd4 /tests/mason-core/installer/linker_spec.lua | |
| parent | feat(path): add relative(from, to) (diff) | |
| download | mason-80944cbf22e10a4debe59d2f0166fb0cd7b1b1aa.tar mason-80944cbf22e10a4debe59d2f0166fb0cd7b1b1aa.tar.gz mason-80944cbf22e10a4debe59d2f0166fb0cd7b1b1aa.tar.bz2 mason-80944cbf22e10a4debe59d2f0166fb0cd7b1b1aa.tar.lz mason-80944cbf22e10a4debe59d2f0166fb0cd7b1b1aa.tar.xz mason-80944cbf22e10a4debe59d2f0166fb0cd7b1b1aa.tar.zst mason-80944cbf22e10a4debe59d2f0166fb0cd7b1b1aa.zip | |
feat(linker): use relative targets for symlinks (#1525)
Closes #1156.
Diffstat (limited to 'tests/mason-core/installer/linker_spec.lua')
| -rw-r--r-- | tests/mason-core/installer/linker_spec.lua | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/tests/mason-core/installer/linker_spec.lua b/tests/mason-core/installer/linker_spec.lua index eb5ce394..9d3afeac 100644 --- a/tests/mason-core/installer/linker_spec.lua +++ b/tests/mason-core/installer/linker_spec.lua @@ -14,7 +14,7 @@ EXIT /b SETLOCAL CALL :find_dp0 -endLocal & goto #_undefined_# 2>NUL || title %%COMSPEC%% & "%s" %%*]] +endLocal & goto #_undefined_# 2>NUL || title %%COMSPEC%% & "%%dp0%%\%s" %%*]] describe("linker", function() local snapshot @@ -63,13 +63,10 @@ describe("linker", function() assert.spy(fs.async.symlink).was_called(2) assert .spy(fs.async.symlink) - .was_called_with(path.concat { dummy:get_install_path(), "another-executable" }, ctx.location:bin "another-executable") + .was_called_with("../packages/dummy/another-executable", ctx.location:bin "another-executable") assert .spy(fs.async.symlink) - .was_called_with( - path.concat { dummy:get_install_path(), "nested", "path", "my-executable" }, - ctx.location:bin "my-executable" - ) + .was_called_with("../packages/dummy/nested/path/my-executable", ctx.location:bin "my-executable") end) it("should write executable wrapper on Windows", function() @@ -101,14 +98,15 @@ describe("linker", function() assert.spy(fs.async.symlink).was_called(0) assert.spy(fs.async.write_file).was_called(2) - assert.spy(fs.async.write_file).was_called_with( - ctx.location:bin "another-executable.cmd", - WIN_CMD_SCRIPT:format(path.concat { dummy:get_install_path(), "another-executable" }) - ) - assert.spy(fs.async.write_file).was_called_with( - ctx.location:bin "my-executable.cmd", - WIN_CMD_SCRIPT:format(path.concat { dummy:get_install_path(), "nested", "path", "my-executable" }) - ) + assert + .spy(fs.async.write_file) + .was_called_with(ctx.location:bin "another-executable.cmd", WIN_CMD_SCRIPT:format "..\\packages\\dummy\\another-executable") + assert + .spy(fs.async.write_file) + .was_called_with( + ctx.location:bin "my-executable.cmd", + WIN_CMD_SCRIPT:format "..\\packages\\dummy\\nested\\path\\my-executable" + ) end) it("should symlink share files", function() @@ -142,13 +140,10 @@ describe("linker", function() assert.spy(fs.async.write_file).was_called(0) assert.spy(fs.async.symlink).was_called(2) + assert.spy(fs.async.symlink).was_called_with("../packages/dummy/share-file", ctx.location:share "share-file") assert .spy(fs.async.symlink) - .was_called_with(path.concat { dummy:get_install_path(), "share-file" }, ctx.location:share "share-file") - assert.spy(fs.async.symlink).was_called_with( - path.concat { dummy:get_install_path(), "nested", "path", "to", "share-file" }, - ctx.location:share "nested/path/share-file" - ) + .was_called_with("../../../packages/dummy/nested/path/to/share-file", ctx.location:share "nested/path/share-file") assert.spy(fs.async.mkdirp).was_called(2) assert.spy(fs.async.mkdirp).was_called_with(ctx.location:share "nested/path") |
