aboutsummaryrefslogtreecommitdiff
path: root/tests/test.lua
diff options
context:
space:
mode:
authorStefan Hoffmann <stefan991@gmail.com>2014-08-09 12:33:33 +0200
committerStefan Hoffmann <stefan991@gmail.com>2014-08-09 12:33:33 +0200
commit4437e194558279b31878965d1c4b2188b1a8cf39 (patch)
treef8db6b102a3ac4226fbfbb52310e1896dbae2ad2 /tests/test.lua
parent6b178640f0c83cfcd74e7fbc81d4a4cab5fe4748 (diff)
downloadluafilesystem-4437e194558279b31878965d1c4b2188b1a8cf39.tar.gz
luafilesystem-4437e194558279b31878965d1c4b2188b1a8cf39.tar.bz2
luafilesystem-4437e194558279b31878965d1c4b2188b1a8cf39.zip
Fix lfs.attributes(file, 'blksize')
fs.attributes(file, 'blksize') and fs.attributes(file, 'blocks) return the wrong values. Compare the whole attribute name instead of the first char and remove buggy special casing with wrong indexes into the member array.
Diffstat (limited to 'tests/test.lua')
-rw-r--r--tests/test.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test.lua b/tests/test.lua
index 4990aec..abfbd4d 100644
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -120,6 +120,13 @@ assert (new_att.modification == attrib.modification)
120io.write(".") 120io.write(".")
121io.flush() 121io.flush()
122 122
123-- Check consistency of lfs.attributes values
124local attr = lfs.attributes (tmpfile)
125for key, value in pairs(attr) do
126 assert (value == lfs.attributes (tmpfile, key),
127 "lfs.attributes values not consistent")
128end
129
123-- Remove new file and directory 130-- Remove new file and directory
124assert (os.remove (tmpfile), "could not remove new file") 131assert (os.remove (tmpfile), "could not remove new file")
125assert (lfs.rmdir (tmpdir), "could not remove new directory") 132assert (lfs.rmdir (tmpdir), "could not remove new directory")