aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mason-core/path_spec.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-10-13 17:05:12 +0200
committerWilliam Boman <william@redwill.se>2025-02-19 09:23:19 +0100
commit80944cbf22e10a4debe59d2f0166fb0cd7b1b1aa (patch)
tree9abe9afe34923fce89d6b9b90a1b41445a4d1cd4 /tests/mason-core/path_spec.lua
parentfeat(path): add relative(from, to) (diff)
downloadmason-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/path_spec.lua')
-rw-r--r--tests/mason-core/path_spec.lua22
1 files changed, 6 insertions, 16 deletions
diff --git a/tests/mason-core/path_spec.lua b/tests/mason-core/path_spec.lua
index 4aeb48f1..905df6ab 100644
--- a/tests/mason-core/path_spec.lua
+++ b/tests/mason-core/path_spec.lua
@@ -2,18 +2,8 @@ local path = require "mason-core.path"
describe("path", function()
it("concatenates paths", function()
- assert.equals("foo/bar/baz/~", path.concat { "foo", "bar", "baz", "~" })
- end)
-
- it("concatenates paths on Windows", function()
- local old_os = jit.os
- -- selene: allow(incorrect_standard_library_use)
- jit.os = "windows"
- package.loaded["mason-core.path"] = nil
- local path = require "mason-core.path"
- assert.equals([[foo\bar\baz\~]], path.concat { "foo", "bar", "baz", "~" })
- -- selene: allow(incorrect_standard_library_use)
- jit.os = old_os
+ assert.equals("foo/bar/baz", path.concat { "foo", "bar", "baz" })
+ assert.equals("foo/bar/baz", path.concat { "foo/", "bar/", "baz/" })
end)
it("identifies subdirectories", function()
@@ -28,7 +18,7 @@ describe("path", function()
{
from = "/home/user/dir1/fileA",
to = "/home/user/dir1/fileB",
- expected = "./fileB",
+ expected = "fileB",
},
{
from = "/home/user/dir1/fileA",
@@ -43,7 +33,7 @@ describe("path", function()
{
from = "/home/user/dir1/subdir/fileD",
to = "/home/user/dir1/subdir/fileF",
- expected = "./fileF",
+ expected = "fileF",
},
{
from = "/home/user/dir1/fileG",
@@ -58,12 +48,12 @@ describe("path", function()
{
from = "/fileK",
to = "/home/fileL",
- expected = "./home/fileL",
+ expected = "home/fileL",
},
{
from = "/home/user/fileM",
to = "/home/user/dir1/dir2/fileL",
- expected = "./dir1/dir2/fileL",
+ expected = "dir1/dir2/fileL",
},
}