diff options
author | Hisham <hisham@gobolinux.org> | 2016-10-19 01:35:24 -0400 |
---|---|---|
committer | Hisham <hisham@gobolinux.org> | 2016-10-19 01:35:24 -0400 |
commit | 77c0e0f992329fa1812e5bb948420e9ebb1798c4 (patch) | |
tree | f8f063e128b9dedcadacade849a03a563c4a1351 /tests | |
parent | a332bde584756b14298f51e913bdc309f87e7ff8 (diff) | |
parent | 3c4e563d9c140319e28c419f2710b51a2f6d6d24 (diff) | |
download | luafilesystem-1.7.tar.gz luafilesystem-1.7.tar.bz2 luafilesystem-1.7.zip |
Merge branch 'master' into 1.71.7
Diffstat (limited to '')
-rw-r--r-- | tests/test.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test.lua b/tests/test.lua index 193e0bd..591ee25 100644 --- a/tests/test.lua +++ b/tests/test.lua | |||
@@ -91,6 +91,8 @@ io.flush() | |||
91 | if lfs.link (tmpfile, "_a_link_for_test_", true) then | 91 | if lfs.link (tmpfile, "_a_link_for_test_", true) then |
92 | assert (lfs.attributes"_a_link_for_test_".mode == "file") | 92 | assert (lfs.attributes"_a_link_for_test_".mode == "file") |
93 | assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link") | 93 | assert (lfs.symlinkattributes"_a_link_for_test_".mode == "link") |
94 | assert (lfs.symlinkattributes"_a_link_for_test_".target == tmpfile) | ||
95 | assert (lfs.symlinkattributes("_a_link_for_test_", "target") == tmpfile) | ||
94 | assert (lfs.link (tmpfile, "_a_hard_link_for_test_")) | 96 | assert (lfs.link (tmpfile, "_a_hard_link_for_test_")) |
95 | assert (lfs.attributes (tmpfile, "nlink") == 2) | 97 | assert (lfs.attributes (tmpfile, "nlink") == 2) |
96 | assert (os.remove"_a_link_for_test_") | 98 | assert (os.remove"_a_link_for_test_") |
@@ -130,6 +132,17 @@ for key, value in pairs(attr) do | |||
130 | "lfs.attributes values not consistent") | 132 | "lfs.attributes values not consistent") |
131 | end | 133 | end |
132 | 134 | ||
135 | -- Check that lfs.attributes accepts a table as second argument | ||
136 | local attr2 = {} | ||
137 | lfs.attributes(tmpfile, attr2) | ||
138 | for key, value in pairs(attr2) do | ||
139 | assert (value == lfs.attributes (tmpfile, key), | ||
140 | "lfs.attributes values with table argument not consistent") | ||
141 | end | ||
142 | |||
143 | -- Check that extra arguments are ignored | ||
144 | lfs.attributes(tmpfile, attr2, nil) | ||
145 | |||
133 | -- Remove new file and directory | 146 | -- Remove new file and directory |
134 | assert (os.remove (tmpfile), "could not remove new file") | 147 | assert (os.remove (tmpfile), "could not remove new file") |
135 | assert (lfs.rmdir (tmpdir), "could not remove new directory") | 148 | assert (lfs.rmdir (tmpdir), "could not remove new directory") |