Skip to content

Commit a637d3e

Browse files
committed
test(fs): run cwd deletion test only on Unix
1 parent ae99f3b commit a637d3e

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

tests/fs.test.lua

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,17 @@ describe("mods.fs", function()
119119
assert.are_equal(cwd, fs.cwd())
120120
end)
121121

122-
it("fails when the current directory no longer exists", function()
123-
local root = make_tmp_dir()
124-
assert.is_true(fs.cd(root))
125-
assert.is_true(fs.rm(root, true))
122+
if is_unix then
123+
it("fails when the current directory no longer exists", function()
124+
local root = make_tmp_dir()
125+
assert.is_true(fs.cd(root))
126+
assert.is_true(fs.rm(root, true))
126127

127-
local dir, errmsg, errcode = fs.cwd()
128-
assert.is_true(fs.cd(cwd))
129-
assert.are_same({ "nil", "string", "number" }, { type(dir), type(errmsg), type(errcode) })
130-
end)
128+
local dir, errmsg, errcode = fs.cwd()
129+
assert.is_true(fs.cd(cwd))
130+
assert.are_same({ "nil", "string", "number" }, { type(dir), type(errmsg), type(errcode) })
131+
end)
132+
end
131133
end)
132134

133135
describe("write_bytes()", function()

0 commit comments

Comments
 (0)