summaryrefslogtreecommitdiff
path: root/tests/modules/os/test.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-09-17 00:49:44 +0800
committerruki <[email protected]>2022-09-17 00:49:44 +0800
commit5328e53c1c082a551ec5a32f7a2fb5cf349237ba (patch)
treed3504ccb0d122cc0dd401cb7fdb2b8a1526fdb57 /tests/modules/os/test.lua
parentc7117c430c7eed7605b3a757ef2e8c0b3895da86 (diff)
test os.cp with symlink
Diffstat (limited to 'tests/modules/os/test.lua')
-rw-r--r--tests/modules/os/test.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/modules/os/test.lua b/tests/modules/os/test.lua
index 03d948dfe..b435807f2 100644
--- a/tests/modules/os/test.lua
+++ b/tests/modules/os/test.lua
@@ -64,6 +64,23 @@ function test_cp_symlink(t)
os.cp("test2", "test4", {symlink = true})
t:require(os.isfile("test4"))
t:require(os.islink("test4"))
+ os.mkdir("dir")
+ os.touch("dir/test1")
+ os.cd("dir")
+ os.ln("test1", "test2")
+ os.cd("-")
+ t:require(os.islink("dir/test2"))
+ os.cp("dir", "dir2")
+ t:require(not os.islink("dir2/test2"))
+ os.cp("dir", "dir3", {symlink = true})
+ t:require(os.islink("dir3/test2"))
+ os.tryrm("test1")
+ os.tryrm("test2")
+ os.tryrm("test3")
+ os.tryrm("test4")
+ os.tryrm("dir")
+ os.tryrm("dir2")
+ os.tryrm("dir3")
end
function test_setenv(t)